import { AlertTriangle, X } from "lucide-react"; import { useTranslation } from "react-i18next"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; import type { StreamError } from "@/lib/nanobot-client"; interface StreamErrorNoticeProps { error: StreamError; onDismiss: () => void; } /** * Dismissible banner that surfaces transport-level faults the user needs to * know about. Rendered above the composer so the message the fault referred * to remains in view just above. ``role="alert"`` + ``aria-live="assertive"`` * ensures screen readers announce the failure. */ export function StreamErrorNotice({ error, onDismiss }: StreamErrorNoticeProps) { const { t } = useTranslation(); const { title, body } = resolveCopy(error, t); return (
{title}
{body}