@@ -11,6 +11,7 @@ import { CopyIcon, CheckIcon } from '@/components/icons'
1111import { cn } from '@/lib/utils'
1212import { useTranslation } from '@/lib/use-translation'
1313import { DEFAULT_SESSION_PREVIEW_LIMIT , useSessionPreviewLimit } from '@/hooks/useSessionPreviewLimit'
14+ import { AgentFlavorIcon } from '@/components/AgentFlavorIcon'
1415
1516type SessionGroup = {
1617 key : string
@@ -481,45 +482,6 @@ function SessionListSearch(props: {
481482 )
482483}
483484
484- const FLAVOR_BADGES : Record < string , { label : string ; colors : string } > = {
485- claude : {
486- label : 'Cl' ,
487- colors : 'bg-[#d97706] text-white' ,
488- } ,
489- codex : {
490- label : 'Cx' ,
491- colors : 'bg-[#111827] text-white' ,
492- } ,
493- cursor : {
494- label : 'Cu' ,
495- colors : 'bg-[#0f766e] text-white' ,
496- } ,
497- gemini : {
498- label : 'Gm' ,
499- colors : 'bg-[#2563eb] text-white' ,
500- } ,
501- kimi : {
502- label : 'Km' ,
503- colors : 'bg-[#7c3aed] text-white' ,
504- } ,
505- opencode : {
506- label : 'Op' ,
507- colors : 'bg-[#15803d] text-white' ,
508- } ,
509- }
510-
511- function FlavorIcon ( { flavor, className } : { flavor ?: string | null ; className ?: string } ) {
512- const badge = FLAVOR_BADGES [ ( flavor ?? 'claude' ) . trim ( ) . toLowerCase ( ) ] ?? FLAVOR_BADGES . claude
513- return (
514- < span
515- aria-hidden = "true"
516- className = { `inline-flex items-center justify-center rounded-sm text-[8px] font-semibold leading-none ${ badge . colors } ${ className ?? 'h-4 w-4' } ` }
517- >
518- { badge . label }
519- </ span >
520- )
521- }
522-
523485function MachineIcon ( props : { className ?: string } ) {
524486 return (
525487 < svg
@@ -604,7 +566,7 @@ function SessionItem(props: {
604566 >
605567 < div className = { `flex items-center justify-between gap-3 ${ ! s . active ? 'opacity-50' : '' } ` } >
606568 < div className = "flex items-center gap-2 min-w-0" >
607- < FlavorIcon flavor = { s . metadata ?. flavor } className = "h-4 w-4 shrink-0" />
569+ < AgentFlavorIcon flavor = { s . metadata ?. flavor } className = "h-4 w-4 shrink-0" />
608570 < div className = { `truncate text-sm font-medium ${ s . active ? 'text-[var(--app-fg)]' : 'text-[var(--app-hint)]' } ` } >
609571 { sessionName }
610572 </ div >
0 commit comments