import { useState } from 'react' import type { TeamState } from '@hapi/protocol/types' function memberStatusDot(status?: string): string { if (status === 'active') return 'bg-emerald-500' if (status === 'shutdown') return 'bg-red-500' return 'bg-gray-400' } function taskStatusColor(status?: string): string { if (status === 'completed') return 'text-emerald-600' if (status === 'in_progress') return 'text-[var(--app-link)]' if (status === 'blocked') return 'text-red-500' return 'text-[var(--app-hint)]' } function taskStatusIcon(status?: string): string { if (status === 'completed') return '\u2611' if (status === 'in_progress') return '\u25b6' if (status === 'blocked') return '\u26a0' return '\u2610' } export function TeamPanel(props: { teamState: TeamState }) { const [expanded, setExpanded] = useState(false) const { teamState } = props const members = teamState.members ?? [] const tasks = teamState.tasks ?? [] const messages = teamState.messages ?? [] const completedTasks = tasks.filter(t => t.status === 'completed').length const activeMembers = members.filter(m => m.status === 'active').length return (
{teamState.description}
)} {/* Members */} {members.length > 0 && (