import type { ReactNode } from 'react'
import { Codicon } from '@/components/ui/codicon'
import { cn } from '@/lib/utils'
// The single canonical error glyph (codicon's filled error mark). Use this
// everywhere an error is surfaced (boundaries, dialogs, banners) so failures
// read identically — one icon, one color, no background chip.
export function ErrorIcon({ className, size = '1.75rem' }: { className?: string; size?: string }) {
return
}
export interface ErrorStateProps {
/** Optional actions row/stack rendered below the copy. */
children?: ReactNode
className?: string
description?: ReactNode
/** Defaults to a destructive AlertCircle. */
icon?: ReactNode
title: ReactNode
}
// Shared, presentation-only error layout: the canonical ErrorIcon (no bg chip)
// over a centered title + body, with an optional actions stack. Used by the
// React error boundary, the in-dialog update error, and the boot-failure banner
// so every failure reads the same. Title/description accept nodes so Radix
// Dialog callers can pass DialogTitle/DialogDescription for accessibility.
export function ErrorState({ children, className, description, icon, title }: ErrorStateProps) {
return (
{icon ??
}
{typeof title === 'string' ? (
{title}
) : (
title
)}
{typeof description === 'string' ? (
{description}
) : (
description
)}
{children &&
{children}
}
)
}