import React from 'react'; import { Box, Text } from 'ink'; import { MonitorState } from './types.js'; import { formatProgress } from './factory.js'; interface ActiveMissionProps { state: MonitorState; } export function ActiveMission({ state }: ActiveMissionProps) { const { activeTask, stats } = state; const pct = stats.total > 0 ? Math.round((stats.completed / stats.total) * 100) : 0; const bar = formatProgress(stats.completed, stats.total, 24); const desc = activeTask?.description; return ( ◈ ACTIVE MISSION {activeTask ? ( {`[T-${activeTask.step_number}] ${activeTask.title}`.substring(0, 52)} {activeTask.status} {activeTask.severity} {activeTask.category} {desc && {desc.substring(0, 60)}{desc.length > 60 ? '…' : ''}} Progress {pct}% {bar} ) : ( ● Nominal. No active mission. Velocity {pct}% {bar} )} ); }