'use client' import type { SubSession } from '@/app/(admin)/ai/ocr-pipeline/types' interface BoxSessionTabsProps { parentSessionId: string subSessions: SubSession[] activeSessionId: string onSessionChange: (sessionId: string) => void } const STATUS_ICONS: Record = { pending: '\u23F3', // hourglass processing: '\uD83D\uDD04', // arrows completed: '\u2713', // checkmark } function getStatusIcon(sub: SubSession): string { if (sub.status === 'completed' || (sub.current_step && sub.current_step >= 9)) return STATUS_ICONS.completed if (sub.current_step && sub.current_step > 1) return STATUS_ICONS.processing return STATUS_ICONS.pending } export function BoxSessionTabs({ parentSessionId, subSessions, activeSessionId, onSessionChange }: BoxSessionTabsProps) { if (subSessions.length === 0) return null const isParentActive = activeSessionId === parentSessionId return (
{/* Main session tab */}
{/* Sub-session tabs */} {subSessions.map((sub) => { const isActive = activeSessionId === sub.id const icon = getStatusIcon(sub) return ( ) })}
) }