Files
Zero/apps/mail/app/error.tsx
2025-05-03 18:32:20 +05:30

38 lines
1.1 KiB
TypeScript

'use client';
import { Button } from '@/components/ui/button';
import { signOut } from '@/lib/auth-client';
import React, { useEffect } from 'react';
export default function Error({ error, reset }: { error: Error; reset: () => void }) {
useEffect(() => {
console.error(error);
}, [error]);
return (
<div className="dark:bg-background flex w-full items-center justify-center bg-white text-center">
<div className="flex-col items-center justify-center md:flex dark:text-gray-100">
{/* Message */}
<div className="space-y-2">
<h2 className="text-2xl font-semibold tracking-tight">Something went wrong!</h2>
<p className="text-muted-foreground">See the console for more information.</p>
</div>
{/* Buttons */}
<div className="mt-2">
<Button
variant="outline"
onClick={async () => {
await signOut();
window.location.href = '/login';
}}
className="text-muted-foreground gap-2"
>
Try again
</Button>
</div>
</div>
</div>
);
}