- Replace ESLint with Biome for linting and formatting - Configure Biome with tabs, double quotes, and organized imports - Move all SQL/Drizzle queries from page.tsx files to data.ts files - Create new data.ts files for: ajustes, dashboard, relatorios/categorias - Update existing data.ts files: extrato, fatura (add lancamentos queries) - Remove all drizzle-orm imports from page.tsx files - Update README.md with new tooling info Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
54 lines
1.4 KiB
TypeScript
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 Error({
|
|
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>
|
|
);
|
|
}
|