99 lines
3.1 KiB
TypeScript
99 lines
3.1 KiB
TypeScript
// * Packages
|
|
import { SquareArrowOutUpRightIcon } from "lucide-react";
|
|
import { usePage } from "@inertiajs/react";
|
|
// * Components shadcn
|
|
import AuthenticatedLayout from "@/back/Layouts/AuthenticatedLayout";
|
|
import {
|
|
Card,
|
|
CardContent,
|
|
CardDescription,
|
|
CardHeader,
|
|
} from "@/components/ui/card";
|
|
// * Other
|
|
import BtnOptionnalLinkWithTooltip from "@/back/Components/BtnOptionnalLinkWithTooltip";
|
|
import useTrans from "@/hooks/use-translations";
|
|
import { AppEnv } from "@/types/global";
|
|
import logoUwilReportLight from "&/images/logos/uwil-report-light.svg";
|
|
import logoUwilReportDark from "&/images/logos/uwil-report-dark.svg";
|
|
|
|
export default function Dashboard() {
|
|
const appEnv = usePage().props.appEnv as AppEnv;
|
|
const theme = localStorage.getItem("vite-ui-theme");
|
|
const tools = [
|
|
{
|
|
image: theme === "dark" ? logoUwilReportLight : logoUwilReportDark,
|
|
description: useTrans("uwil-backend::back.uwil_report_desc"),
|
|
label: "UWIL Report",
|
|
link: "https://report.uwil.fr",
|
|
},
|
|
];
|
|
const uwilTooltip = useTrans("uwil-backend::back.uwil_util_tooltip");
|
|
|
|
return (
|
|
<AuthenticatedLayout title={useTrans("uwil-backend::back.dashboard")}>
|
|
<p
|
|
className="leading-7"
|
|
// eslint-disable-next-line react/no-danger
|
|
dangerouslySetInnerHTML={{
|
|
__html: useTrans("uwil-backend::back.dashboard_paragraph_1", {
|
|
params: { appName: appEnv.name },
|
|
}),
|
|
}}
|
|
/>
|
|
<p className="leading-7 mb-4">
|
|
{useTrans("uwil-backend::back.dashboard_paragraph_2")}
|
|
</p>
|
|
<p
|
|
className="leading-7 mb-4"
|
|
// eslint-disable-next-line react/no-danger
|
|
dangerouslySetInnerHTML={{
|
|
__html: useTrans("uwil-backend::back.dashboard_paragraph_3", {
|
|
params: { appName: appEnv.name },
|
|
}),
|
|
}}
|
|
/>
|
|
<p
|
|
className="leading-7 mb-4"
|
|
// eslint-disable-next-line react/no-danger
|
|
dangerouslySetInnerHTML={{
|
|
__html: useTrans("uwil-backend::back.dashboard_paragraph_4", {
|
|
params: { appName: appEnv.name },
|
|
}),
|
|
}}
|
|
/>
|
|
<div className="flex justify-start items-stretch gap-2">
|
|
{tools.map((tool) => (
|
|
<Card
|
|
key={tool.link}
|
|
className="flex flex-col justify-between text-center w-[20rem]"
|
|
>
|
|
<CardHeader>
|
|
<img
|
|
src={tool.image}
|
|
alt={`${tool.label} logo`}
|
|
className="w-fit h-[4rem] mx-auto"
|
|
/>
|
|
<CardDescription className="pt-4">
|
|
{tool.description}
|
|
</CardDescription>
|
|
</CardHeader>
|
|
<CardContent>
|
|
<BtnOptionnalLinkWithTooltip
|
|
link={tool.link}
|
|
content={
|
|
<>
|
|
{tool.label}
|
|
<SquareArrowOutUpRightIcon />
|
|
</>
|
|
}
|
|
tooltipContent={<p>{uwilTooltip}</p>}
|
|
size="default"
|
|
externalLink
|
|
/>
|
|
</CardContent>
|
|
</Card>
|
|
))}
|
|
</div>
|
|
</AuthenticatedLayout>
|
|
);
|
|
}
|