import { memo, useCallback } from 'react'; import { cn } from '@/lib/utils'; import { useDeployFeedback, VERB_LABELS } from '@/context/DeployFeedbackContext'; interface DeployFeedbackPillProps { isVisible: boolean; onExpand: () => void; } function DeployFeedbackPillBase({ isVisible, onExpand }: DeployFeedbackPillProps) { const { panelState } = useDeployFeedback(); const { stackName, action, status } = panelState; const handleKeyDown = useCallback((e: React.KeyboardEvent) => { if (e.key === 'Enter' || e.key === ' ') onExpand(); }, [onExpand]); if (!isVisible) return null; const verbLabel = VERB_LABELS[action]; const dotClass = cn( 'h-2 w-2 rounded-full shrink-0', (status === 'preparing' || status === 'streaming') && 'bg-brand animate-pulse', status === 'succeeded' && 'bg-success', status === 'failed' && 'bg-destructive', ); const textClass = cn( 'text-xs', (status === 'preparing' || status === 'streaming') && 'text-foreground', status === 'succeeded' && 'text-success', status === 'failed' && 'text-destructive', ); return (