@@ -3,7 +3,7 @@ import { useAtomValue } from "jotai";
33import { Eye } from "lucide-react" ;
44import { useMemo } from "react" ;
55import { useTranslation } from "../../../../lib/i18n" ;
6- import { supervisorCyclesAtom , supervisorsAtom } from "../../atoms" ;
6+ import { supervisorsAtom } from "../../atoms" ;
77
88interface MobileSupervisorBadgeProps {
99 sessionId : string | null ;
@@ -12,7 +12,6 @@ interface MobileSupervisorBadgeProps {
1212
1313export function MobileSupervisorBadge ( { sessionId, onOpen } : MobileSupervisorBadgeProps ) {
1414 const supervisors = useAtomValue ( supervisorsAtom ) ;
15- const cyclesBySupervisor = useAtomValue ( supervisorCyclesAtom ) ;
1615 const t = useTranslation ( ) ;
1716
1817 const copy = useMemo ( ( ) => {
@@ -28,19 +27,11 @@ export function MobileSupervisorBadge({ sessionId, onOpen }: MobileSupervisorBad
2827 } ;
2928 }
3029
31- const cycles = cyclesBySupervisor . get ( supervisor . id ) ?? supervisor . cycles ?? [ ] ;
32- const latestCycle = [ ...cycles ] . sort (
33- ( left , right ) => ( right . completedAt ?? right . createdAt ) - ( left . completedAt ?? left . createdAt )
34- ) [ 0 ] ;
35-
3630 return {
3731 state : supervisor . state ,
38- label :
39- latestCycle ?. result ??
40- latestCycle ?. errorReason ??
41- ( cycles . length > 0 ? `cycle ${ cycles . length } ` : supervisor . objective ) ,
32+ label : t ( "supervisor.title" ) ,
4233 } ;
43- } , [ cyclesBySupervisor , sessionId , supervisors , t ] ) ;
34+ } , [ sessionId , supervisors , t ] ) ;
4435
4536 if ( ! copy ) {
4637 return null ;
0 commit comments