import * as React from 'react'
import { Text } from '@anthropic/ink'
import { useAppState } from '../../state/AppState.js'
type Props = {
teamsSelected: boolean
showHint: boolean
}
/**
* Footer status indicator showing teammate count
* Similar to BackgroundTaskStatus but for teammates
*/
export function TeamStatus({
teamsSelected,
showHint,
}: Props): React.ReactNode {
const teamContext = useAppState(s => s.teamContext)
// Derive teammate count from teamContext (no filesystem I/O needed)
const totalTeammates = teamContext
? Object.values(teamContext.teammates).filter(t => t.name !== 'team-lead')
.length
: 0
if (totalTeammates === 0) {
return null
}
const hint =
showHint && teamsSelected ? (
<>
ยท
Enter to view
>
) : null
const statusText = `${totalTeammates} ${totalTeammates === 1 ? 'teammate' : 'teammates'}`
return (
<>
{statusText}
{hint ? {hint} : null}
>
)
}