/** * TeamHeader — the identity strip above a team's task board (#3374 PR2). * * Shows the team's summary (falling back to its lead agent id), the lead, a * task/member count line, and a compact roster of member chips. Each chip * carries the member's deterministic colour (so a member reads the same on the * header, the board border and the activity rail) and a status dot * (active / pending / idle / stopped). For the small teams this surface targets * (≈2–5 members) a header strip is the right density — a full sidebar would be * heavy furniture for three chips. */ import { LuLoaderCircle, LuPlay } from 'react-icons/lu'; import { useT } from '../../lib/i18n/I18nContext'; import type { AgentTeam, AgentTeamMember, AgentTeamMemberStatus, } from '../../services/api/agentTeamApi'; import { memberColor } from './memberColors'; /** Status dot colour per member lifecycle state. */ const MEMBER_STATUS_DOT: Record = { active: 'bg-sage-500', pending: 'bg-amber-500', idle: 'bg-stone-400 dark:bg-neutral-500', stopped: 'bg-coral-500', }; const MEMBER_STATUS_KEY: Record = { active: 'intelligence.teams.member.active', pending: 'intelligence.teams.member.pending', idle: 'intelligence.teams.member.idle', stopped: 'intelligence.teams.member.stopped', }; interface TeamHeaderProps { team: AgentTeam; members: AgentTeamMember[]; taskCount: number; /** When provided, renders a "Start" affordance on each non-active member. */ onStartMember?: (memberId: string) => void; /** Id of the member whose live run is currently being dispatched. */ startingMemberId?: string | null; } export function TeamHeader({ team, members, taskCount, onStartMember, startingMemberId, }: TeamHeaderProps) { const { t } = useT(); const title = team.summary?.trim() || team.leadAgentId; return (
{title}
{t('intelligence.teams.header.lead')}{' '} {team.leadAgentId} {' · '} {t('intelligence.teams.header.taskCount').replace('{count}', String(taskCount))} {' · '} {t('intelligence.teams.header.memberCount').replace('{count}', String(members.length))}
{members.map(member => ( {member.name.charAt(0).toUpperCase()} {member.name} {onStartMember && member.memberStatus !== 'active' && ( )} ))}
); }