interface Props {
  onRetry: () => void;
  onDiscard: () => void;
}

// v1.12.3: shown when an assistant message has been 'streaming' for 60+
// seconds without new tokens. Lives above ChatInput in ChatPane. Retry
// discards the stuck row then resends the last user message; Discard just
// clears the row and drops the dot to idle.
export function StaleStreamBanner({ onRetry, onDiscard }: Props) {
  return (
    <div className="border border-amber-500/30 bg-amber-500/5 rounded-md p-3 mb-2 mx-4 flex items-center justify-between gap-2">
      <span className="text-sm text-muted-foreground">
        Previous response didn't complete.
      </span>
      <div className="flex gap-2">
        <button
          type="button"
          onClick={onRetry}
          className="text-xs px-2 py-1 rounded border border-border hover:bg-accent max-md:min-h-[44px] max-md:px-3"
        >
          Retry
        </button>
        <button
          type="button"
          onClick={onDiscard}
          className="text-xs px-2 py-1 rounded border border-border hover:bg-accent max-md:min-h-[44px] max-md:px-3"
        >
          Discard
        </button>
      </div>
    </div>
  );
}
