22
33import { GitPullRequestIcon , IssueOpenedIcon } from '@primer/octicons-react'
44import { cva , type VariantProps } from 'class-variance-authority'
5- import { Clock , Code , Filter , Image , Link , Search , TextSelect } from 'lucide-react'
5+ import {
6+ Clock ,
7+ Code ,
8+ Filter ,
9+ Image ,
10+ Link ,
11+ MailCheck ,
12+ MessageSquareDashed ,
13+ Search ,
14+ TextSelect ,
15+ } from 'lucide-react'
616import { useMemo , useState } from 'react'
717import type { CommentSpot } from '@/lib/enhancer'
818import type { DraftStats } from '@/lib/enhancers/draftStats'
919
1020// CVA configuration for stat badges
1121const statBadge = cva ( 'inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs' , {
12- defaultVariants : {
13- type : 'text' ,
14- } ,
1522 variants : {
1623 type : {
1724 code : 'bg-pink-50 text-pink-700' ,
1825 image : 'bg-purple-50 text-purple-700' ,
1926 link : 'bg-blue-50 text-blue-700' ,
27+ sent : 'bg-green-50 text-green-700' ,
2028 text : 'bg-gray-50 text-gray-700' ,
2129 time : 'bg-gray-50 text-gray-700' ,
30+ unsent : 'bg-amber-100 text-amber-700' ,
2231 } ,
2332 } ,
2433} )
@@ -28,22 +37,24 @@ const typeIcons = {
2837 code : Code ,
2938 image : Image ,
3039 link : Link ,
40+ sent : MailCheck ,
3141 text : TextSelect ,
3242 time : Clock ,
43+ unsent : MessageSquareDashed ,
3344} as const
3445
3546// StatBadge component
3647type BadgeProps = VariantProps < typeof statBadge > & {
37- text : number | string
3848 type : keyof typeof typeIcons
49+ text ?: number | string
3950}
4051
4152const Badge = ( { text, type } : BadgeProps ) => {
4253 const Icon = typeIcons [ type ]
4354 return (
4455 < span className = { statBadge ( { type } ) } >
4556 < Icon className = 'w-3 h-3' />
46- { text }
57+ { text || type }
4758 </ span >
4859 )
4960}
@@ -131,7 +142,7 @@ const generateMockDrafts = (): CommentTableRow[] => [
131142 spot : {
132143 number : 1234 ,
133144 slug : 'microsoft/vscode' ,
134- title : ' Fix memory leak in extension host' ,
145+ title : " Fix memory leak in extension host (why is this so hard! It's been months!)" ,
135146 type : 'PR' ,
136147 unique_key : '1' ,
137148 } satisfies GitHubSpot ,
@@ -501,7 +512,7 @@ export const ClaudePrototype = () => {
501512 onChange = { ( e ) => setHasLinkFilter ( e . target . checked ) }
502513 className = 'rounded'
503514 />
504- < Badge type = 'link' text = 'links' />
515+ < Badge type = 'link' />
505516 </ label >
506517 < label className = 'flex items-center gap-2 cursor-pointer' >
507518 < input
@@ -510,7 +521,7 @@ export const ClaudePrototype = () => {
510521 onChange = { ( e ) => setHasImageFilter ( e . target . checked ) }
511522 className = 'rounded'
512523 />
513- < Badge type = 'image' text = 'images' />
524+ < Badge type = 'image' />
514525 </ label >
515526 < label className = 'flex items-center gap-2 cursor-pointer' >
516527 < input
@@ -519,7 +530,7 @@ export const ClaudePrototype = () => {
519530 onChange = { ( e ) => setHasCodeFilter ( e . target . checked ) }
520531 className = 'rounded'
521532 />
522- < Badge type = 'code' text = 'code' />
533+ < Badge type = 'code' />
523534 </ label >
524535 </ div >
525536 </ div >
@@ -602,10 +613,11 @@ function commentRow(
602613 </ div >
603614
604615 { /* Title */ }
605- < div className = 'text-sm truncate hover:underline ' >
606- < a href = 'TODO' className = 'font-medium' >
616+ < div className = 'flex items-center gap-1 ' >
617+ < a href = 'TODO' className = 'text-sm font-medium hover:underline truncate ' >
607618 { row . spot . title }
608619 </ a >
620+ < Badge type = { row . isSent ? 'sent' : 'unsent' } />
609621 </ div >
610622 { /* Draft */ }
611623 < div className = 'text-sm truncate' >
0 commit comments