"use client"; import type { ComponentProps } from "react"; import { CircleAlertIcon, RefreshCwIcon } from "lucide-react"; import { cn } from '../../lib/utils'; import { ShimmerLabel } from './surfaces'; export interface ErrorStateProps extends Omit< ComponentProps<"div">, "children" | "role" > { title: string; detail: string; retrying: boolean; /** Omit when nothing can be retried; the button is then not rendered. */ onRetry?: () => void; } export function ErrorState({ title, detail, retrying, onRetry, className, ...props }: ErrorStateProps) { if (retrying) { return (
Retrying
); } return (

{title}

{detail}

{onRetry ? ( ) : null}
); }