"use client"; import { IconCheck } from "@tabler/icons-react"; import { useTranslation } from "react-i18next"; import { MobilePickerSheet } from "@/components/task/mobile/mobile-picker-sheet"; import type { ActiveThread } from "@/lib/threads/active-threads"; import { resolveThreadColumnStatus } from "@/lib/threads/thread-session-status"; import { ThreadSessionStatusIcon } from "./thread-session-switcher"; export function MobileThreadPicker({ threads, selectedTaskId, open, onOpenChange, onSelect, onCloseAutoFocus, }: { threads: readonly ActiveThread[]; selectedTaskId: string | null; open: boolean; onOpenChange: (open: boolean) => void; onSelect: (taskId: string) => void; onCloseAutoFocus: (event: Event) => void; }) { const { t } = useTranslation(); return (
{threads.map((thread) => { const selected = selectedTaskId === thread.taskId; const status = resolveThreadColumnStatus({ taskState: thread.taskState, reviewStatus: thread.reviewStatus, taskPendingAction: thread.taskPendingAction, session: { state: thread.sessionState, pending_action: thread.pendingAction }, }); return ( ); })}
); }