"use client"; import { AlertCircle, RefreshCw } from "@/components/icons"; import type { AppIcon } from "@/components/icons"; import { Button } from "@/components/ui/button"; import { getPathPrefix } from "@/lib/browser-navigation"; import { cn } from "@/lib/utils"; import type { FallbackProps } from "./error-boundary"; export interface ErrorStateProps { title: string; description?: string; /** Puts the part back together: re-renders it, or reloads the route. */ onRetry: () => void; retryLabel: string; /** Offers a way out to the inbox; left out inside mail itself. */ homeLabel?: string; icon?: AppIcon; className?: string; } /** * The one error fallback: icon, title, a line of text, "Try again", and "Go * to inbox" where the inbox is somewhere else. Every error boundary draws * this, at whatever size its pane has. */ export function ErrorState({ title, description, onRetry, retryLabel, homeLabel, icon: Icon = AlertCircle, className }: ErrorStateProps) { return (
{description}
}