1- import Badge from ' @/components/Badge'
2- import { timeAgo } from ' @/components/misc'
3- import type { CommentTableRow } from ' @/entrypoints/background'
4- import { openOrFocusComment } from ' @/entrypoints/popup/popup'
5- import { EnhancerRegistry } from ' @/lib/registries'
1+ import Badge from " @/components/Badge"
2+ import { timeAgo } from " @/components/misc"
3+ import type { CommentTableRow } from " @/entrypoints/background"
4+ import { openOrFocusComment } from " @/entrypoints/popup/popup"
5+ import { EnhancerRegistry } from " @/lib/registries"
66
77const enhancers = new EnhancerRegistry ( )
88
@@ -14,60 +14,86 @@ type CommentRowProps = {
1414 handleTrash : ( row : CommentTableRow ) => void
1515}
1616
17- export function CommentRow ( { row, selectedIds, toggleSelection } : CommentRowProps ) {
17+ export function CommentRow ( {
18+ row,
19+ selectedIds,
20+ toggleSelection,
21+ } : CommentRowProps ) {
1822 const enhancer = enhancers . enhancerFor ( row . spot )
1923
2024 const handleTitleClick = ( ) => {
2125 openOrFocusComment ( row . spot . unique_key )
2226 }
2327 return (
24- < tr className = ' hover:bg-gray-50' >
25- < td className = ' px-3 py-3' >
28+ < tr className = " hover:bg-gray-50" >
29+ < td className = " px-3 py-3" >
2630 < input
27- type = ' checkbox'
31+ type = " checkbox"
2832 checked = { selectedIds . has ( row . spot . unique_key ) }
2933 onChange = { ( ) => toggleSelection ( row . spot . unique_key ) }
30- className = ' rounded'
34+ className = " rounded"
3135 />
3236 </ td >
33- < td className = ' px-3 py-3' >
34- < div className = ' space-y-1' >
37+ < td className = " px-3 py-3" >
38+ < div className = " space-y-1" >
3539 { /* Context line */ }
36- < div className = ' flex items-center justify-between gap-1.5 text-gray-600 text-xs' >
37- < div className = ' flex min-w-0 flex-1 items-center gap-1.5' >
40+ < div className = " flex items-center justify-between gap-1.5 text-gray-600 text-xs" >
41+ < div className = " flex min-w-0 flex-1 items-center gap-1.5" >
3842 { enhancer . tableUpperDecoration ( row . spot ) }
3943 </ div >
40- < div className = ' flex flex-shrink-0 items-center gap-1' >
44+ < div className = " flex flex-shrink-0 items-center gap-1" >
4145 { row . latestDraft . stats . links . length > 0 && (
42- < Badge type = 'link' text = { row . latestDraft . stats . links . length } data = { row } />
46+ < Badge
47+ type = "link"
48+ text = { row . latestDraft . stats . links . length }
49+ data = { row }
50+ />
4351 ) }
4452 { row . latestDraft . stats . images . length > 0 && (
45- < Badge type = 'image' text = { row . latestDraft . stats . images . length } data = { row } />
53+ < Badge
54+ type = "image"
55+ text = { row . latestDraft . stats . images . length }
56+ data = { row }
57+ />
4658 ) }
4759 { row . latestDraft . stats . codeBlocks . length > 0 && (
48- < Badge type = 'code' text = { row . latestDraft . stats . codeBlocks . length } data = { row } />
60+ < Badge
61+ type = "code"
62+ text = { row . latestDraft . stats . codeBlocks . length }
63+ data = { row }
64+ />
4965 ) }
50- < Badge type = 'text' text = { row . latestDraft . stats . charCount } data = { row } />
51- < Badge type = 'time' text = { timeAgo ( row . latestDraft . time ) } data = { row } />
52- { row . isOpenTab && < Badge type = 'open' data = { row } /> }
66+ < Badge
67+ type = "text"
68+ text = { row . latestDraft . stats . charCount }
69+ data = { row }
70+ />
71+ < Badge
72+ type = "time"
73+ text = { timeAgo ( row . latestDraft . time ) }
74+ data = { row }
75+ />
76+ { row . isOpenTab && < Badge type = "open" data = { row } /> }
5377 </ div >
5478 </ div >
5579
5680 { /* Title */ }
57- < div className = ' flex items-center gap-1' >
81+ < div className = " flex items-center gap-1" >
5882 < button
59- type = ' button'
83+ type = " button"
6084 onClick = { handleTitleClick }
61- className = ' cursor-pointer truncate text-left font-medium text-sm hover:underline'
85+ className = " cursor-pointer truncate text-left font-medium text-sm hover:underline"
6286 >
6387 { enhancer . tableTitle ( row . spot ) }
6488 </ button >
65- < Badge type = { row . isSent ? ' sent' : ' unsent' } />
66- { row . isTrashed && < Badge type = ' trashed' /> }
89+ < Badge type = { row . isSent ? " sent" : " unsent" } />
90+ { row . isTrashed && < Badge type = " trashed" /> }
6791 </ div >
6892 { /* Draft */ }
69- < div className = 'truncate text-sm' >
70- < span className = 'text-gray-500' > { row . latestDraft . content . substring ( 0 , 100 ) } …</ span >
93+ < div className = "truncate text-sm" >
94+ < span className = "text-gray-500" >
95+ { row . latestDraft . content . substring ( 0 , 100 ) } …
96+ </ span >
7197 </ div >
7298 </ div >
7399 </ td >
0 commit comments