w-lab-app/src/app/[locale]/(core)/error.tsx
gofnnp 67f4dfdf3d main
compatibility & palm generations & add zustand & config prettier eslint
2025-06-23 00:46:11 +04:00

35 lines
739 B
TypeScript

"use client";
import { useEffect } from "react";
import { Button, Typography } from "@/components/ui";
import styles from "./error.module.scss";
export default function Error({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) {
useEffect(() => {
// eslint-disable-next-line no-console
console.error(error);
}, [error]);
return (
<div className={styles.coreError}>
<Typography as="h2" size="xl" weight="bold">
Something went wrong!
</Typography>
<Typography as="p" align="center">
{error.message}
</Typography>
<Button onClick={() => reset()}>
<Typography color="white">Try again</Typography>
</Button>
</div>
);
}