import { cn } from "cn";
import { AlertCircleIcon } from "@/components/icons";

/**
 * Shown above the send button when the send itself failed (server error or no connection; no Figma design).
 * Not a field error: those stay on their fields. The form keeps everything that was typed.
 */
export function FormFailure({ message, className }: { message: string; className?: string }) {
  return (
    <p role="alert" className={cn("flex items-start gap-2 rounded-xl border border-destructive/40 bg-destructive/10 p-4 text-sm leading-6 text-white", className)}>
      <AlertCircleIcon className="mt-0.5 size-5 shrink-0 text-destructive" />
      {message}
    </p>
  );
}
