/** * Reusable error alert component for displaying API errors visibly. * Used to replace silent error handling across admin and frontend pages. */ 'use client' import { WarningCircle, ArrowClockwise, X } from '@phosphor-icons/react' interface ErrorAlertProps { /** Error message to display */ message: string /** Optional retry callback. Shows a retry button when provided. */ onRetry?: () => void /** Optional dismiss callback. Shows a dismiss button when provided. */ onDismiss?: () => void /** Visual variant: 'page' fills the content area, 'inline' sits alongside content */ variant?: 'page' | 'inline' } export function ErrorAlert({ message, onRetry, onDismiss, variant = 'inline' }: ErrorAlertProps) { if (variant === 'page') { return (
) } return (
) }