55 lines
1.9 KiB
TypeScript
55 lines
1.9 KiB
TypeScript
import { LoaderFunctionArgs, MetaFunction, Outlet } from "react-router";
|
|
import FeedbackIcon from "~/components/ui/icons/FeedbackIcon";
|
|
import FeedbackIconFilled from "~/components/ui/icons/FeedbackIconFilled";
|
|
import IncreaseIcon from "~/components/ui/icons/crm/IncreaseIcon";
|
|
import IncreaseIconFilled from "~/components/ui/icons/crm/IncreaseIconFilled";
|
|
import SidebarIconsLayout from "~/components/ui/layouts/SidebarIconsLayout";
|
|
import { adminPath } from "~/utils/app/CanonicalUrlUtils";
|
|
import { t as i18nT } from "i18next";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
type LoaderData = {
|
|
title: string;
|
|
};
|
|
|
|
export const loader = async ({ request }: LoaderFunctionArgs) => {
|
|
const data: LoaderData = {
|
|
title: i18nT("helpDesk.metaTitle", { appName: process.env.APP_NAME }),
|
|
};
|
|
return data;
|
|
};
|
|
|
|
export const meta: MetaFunction<typeof loader> = ({ data }) => [{ title: data?.title }];
|
|
|
|
export default () => {
|
|
const { t } = useTranslation();
|
|
return (
|
|
<SidebarIconsLayout
|
|
label={{ align: "right" }}
|
|
items={[
|
|
{
|
|
name: t("shared.overview"),
|
|
href: adminPath("help-desk", { mode: "host-aware" }),
|
|
icon: <IncreaseIcon className="h-5 w-5" />,
|
|
iconSelected: <IncreaseIconFilled className="h-5 w-5" />,
|
|
exact: true,
|
|
},
|
|
{
|
|
name: t("helpDesk.tickets.plural"),
|
|
href: adminPath("help-desk/tickets", { mode: "host-aware" }),
|
|
icon: <FeedbackIcon className="h-5 w-5" />,
|
|
iconSelected: <FeedbackIconFilled className="h-5 w-5" />,
|
|
},
|
|
{
|
|
name: t("feedback.object"),
|
|
href: adminPath("help-desk/feedback", { mode: "host-aware" }),
|
|
icon: <FeedbackIcon className="h-5 w-5" />,
|
|
iconSelected: <FeedbackIconFilled className="h-5 w-5" />,
|
|
},
|
|
]}
|
|
>
|
|
<Outlet />
|
|
</SidebarIconsLayout>
|
|
);
|
|
};
|