- Updated translation utility to improve consistency and reduce redundancy. - Removed deprecated useTrans hook and related code. - Introduced a new Zustand store for managing translations and locale settings. - Cleaned up unused hooks and files related to localization.
45 lines
1.9 KiB
TypeScript
45 lines
1.9 KiB
TypeScript
import { Head, Link, usePage } from "@inertiajs/react";
|
|
|
|
import ApplicationLogo from "@/back/Components/ApplicationLogo";
|
|
import AppFooter from "@/back/Components/Layout/AppFooter";
|
|
import { ThemeProvider } from "@/back/providers/ThemeProvider";
|
|
import type { ConfigBackend } from "@/back/types/global";
|
|
import { Button } from "@/components/ui/button";
|
|
import { TooltipProvider } from "@/components/ui/tooltip";
|
|
import trans from "@/hooks/use-translations";
|
|
|
|
export default function Default({ status }: Readonly<{ status: number }>) {
|
|
const routeName = (usePage().props.configBackend as ConfigBackend).routes
|
|
.name;
|
|
return (
|
|
<ThemeProvider defaultTheme="light" storageKey="vite-ui-theme">
|
|
<TooltipProvider>
|
|
<Head title={String(status)} />
|
|
<div className="flex min-h-screen flex-col justify-center items-center px-8">
|
|
<div className="container grid grid-cols-1 gap-6 text-center mx-auto my-auto">
|
|
<ApplicationLogo />
|
|
<h1 className="text-4xl font-extrabold tracking-tight lg:text-5xl">
|
|
{status} - {trans(`errors.${String(status)}.title`)}
|
|
</h1>
|
|
<p className="text-sm md:text-base max-w-md text-center mx-auto">
|
|
{trans(`errors.${String(status)}.description`)}
|
|
</p>
|
|
<div className="flex flex-col sm:flex-row items-center justify-center gap-4">
|
|
<Button asChild>
|
|
<Link href={route(`${routeName}dashboard.index`)}>
|
|
{trans("uwil-backend::back.dashboard")}
|
|
</Link>
|
|
</Button>
|
|
{route(`${routeName}dashboard.index`) !== "/" && (
|
|
<Button variant="outline" asChild>
|
|
<a href="/">{trans("uwil-backend::back.your_website")}</a>
|
|
</Button>
|
|
)}
|
|
</div>
|
|
</div>
|
|
<AppFooter />
|
|
</div>
|
|
</TooltipProvider>
|
|
</ThemeProvider>
|
|
);
|
|
}
|