import { AlertCircle, WifiOff } from "lucide-react"; import { Button } from "@/components/ui/button"; type ProviderDrawerErrorProps = { kind: "not_found" | "network"; onRetry?: () => void; onClose: () => void; }; const COPY = { not_found: { eyebrow: "NOT FOUND", message: "This provider doesn't exist or has been removed.", }, network: { eyebrow: "CONNECTION", message: "Couldn't reach the server. Check your connection and try again.", }, } as const; /** * Error state for the provider drill-down drawer (SP21 Task 2.2). * * Two shapes — `not_found` (the NPI in the URL doesn't resolve on the * server, e.g. a stale deep link) and `network` (the request failed). * The not_found variant has no retry affordance (retrying won't help), * the network variant does when `onRetry` is supplied. * * Visual twin of `RemitDrawerError` / `ClaimDrawerError` so the drawer * family feels like one component family — same icon size, same eyebrow * color, same button spacing. */ export function ProviderDrawerError({ kind, onRetry, onClose, }: ProviderDrawerErrorProps) { const { eyebrow, message } = COPY[kind]; const Icon = kind === "network" ? WifiOff : AlertCircle; return (
{eyebrow}

{message}

{kind === "network" && onRetry ? ( ) : null}
); }