Files
openmonetis/app/error.tsx
Felipe Coutinho 96118d85e4 style: padronizar dialogs e aplicar formatação Biome
DialogContent: padding p-6→p-10, max-w-lg→max-w-xl.
DialogFooter/AlertDialogFooter: botões com flex-1 (largura igual).
Remove gap-3/w-full redundantes de 12+ dialogs.

Reformatação Biome: line wrapping, import ordering.
Error component renomeado para evitar shadowing do global Error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 17:22:59 +00:00

54 lines
1.4 KiB
TypeScript

"use client";
import { RiErrorWarningFill } from "@remixicon/react";
import Link from "next/link";
import { useEffect } from "react";
import { Button } from "@/components/ui/button";
import {
Empty,
EmptyContent,
EmptyDescription,
EmptyHeader,
EmptyMedia,
EmptyTitle,
} from "@/components/ui/empty";
export default function ErrorComponent({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) {
useEffect(() => {
// Log the error to an error reporting service
console.error(error);
}, [error]);
return (
<div className="flex min-h-screen flex-col items-center justify-center p-4">
<Empty className="max-w-md border-0">
<EmptyHeader>
<EmptyMedia variant="icon" className="bg-destructive/10 size-16">
<RiErrorWarningFill className="size-8 text-destructive" />
</EmptyMedia>
<EmptyTitle className="text-2xl">Algo deu errado</EmptyTitle>
<EmptyDescription>
Ocorreu um problema inesperado. Por favor, tente novamente ou volte
para o dashboard.
</EmptyDescription>
</EmptyHeader>
<EmptyContent>
<div className="flex flex-col gap-2 sm:flex-row">
<Button onClick={() => reset()}>Tentar Novamente</Button>
<Button variant="outline" asChild>
<Link href="/dashboard">Voltar para o Dashboard</Link>
</Button>
</div>
</EmptyContent>
</Empty>
</div>
);
}