• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jcubic / 10xDevs / 18574558796

16 Oct 2025 08:56PM UTC coverage: 21.131% (+0.2%) from 20.966%
18574558796

push

github

jcubic
add confirmation dialog

59 of 85 branches covered (69.41%)

Branch coverage included in aggregate %.

423 of 2196 relevant lines covered (19.26%)

2.41 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

3.33
/src/components/notes/MainNotesLayout.tsx
1
import type { Note } from '@prisma/client';
1✔
2
import type { NoteTreeNode } from '@/types/tree';
3
import { getNotes } from '@/app/actions/notes';
×
4
import { NotesProvider } from './NotesContext';
×
5
import MainNotesClient from './MainNotesClient';
×
6
import styles from './MainNotesLayout.module.css';
×
7

8
interface MainNotesLayoutProps {
9
  selectedNoteId?: number;
10
  lineNumber?: number;
11
}
12

13
// Convert Prisma Note to NoteTreeNode
14
function convertNoteToTreeNode(note: Note): NoteTreeNode {
×
15
  return {
×
16
    id: note.id,
×
17
    name: note.name,
×
18
    data: {
×
19
      content: note.content, // Preserve null for example notes
×
20
      dirty: false
×
21
    }
×
22
  };
×
23
}
×
24

25
export default async function MainNotesLayout({
×
26
  selectedNoteId,
×
27
  lineNumber
×
28
}: MainNotesLayoutProps) {
×
29
  // Single fetch - get all notes once
30
  const notes = await getNotes();
×
31

32
  // Convert to TreeNodes
33
  const treeNodes: NoteTreeNode[] = notes.map(convertNoteToTreeNode);
×
34

35
  return (
×
36
    <div className={styles.layout}>
×
37
      <NotesProvider
×
38
        initialNotes={treeNodes}
×
39
        initialSelectedNoteId={selectedNoteId || null}
×
40
      >
41
        <MainNotesClient lineNumber={lineNumber} />
×
42
      </NotesProvider>
×
43
    </div>
×
44
  );
45
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc