122 lines
5.1 KiB
TypeScript
122 lines
5.1 KiB
TypeScript
import { LoaderFunctionArgs, MetaFunction } from "react-router";
|
|
import { Outlet } from "react-router";
|
|
import ViewBoardsEmptyIcon from "~/components/ui/icons/ViewBoardsEmptyIcon";
|
|
import ViewBoardsIcon from "~/components/ui/icons/ViewBoardsIcon";
|
|
import ActivityHistoryIcon from "~/components/ui/icons/entities/ActivityHistoryIcon";
|
|
import ActivityHistoryIconFilled from "~/components/ui/icons/entities/ActivityHistoryIconFilled";
|
|
import CodingIcon from "~/components/ui/icons/entities/CodingIcon";
|
|
import CodingIconFilled from "~/components/ui/icons/entities/CodingIconFilled";
|
|
import FolderIcon from "~/components/ui/icons/entities/FolderIcon";
|
|
import FolderIconFilled from "~/components/ui/icons/entities/FolderIconFilled";
|
|
import ModulesIcon from "~/components/ui/icons/entities/ModulesIcon";
|
|
import ModulesIconFilled from "~/components/ui/icons/entities/ModulesIconFilled";
|
|
import RestApiIcon from "~/components/ui/icons/entities/RestApiIcon";
|
|
import RestApiIconFilled from "~/components/ui/icons/entities/RestApiIconFilled";
|
|
import RowsIcon from "~/components/ui/icons/entities/RowsIcon";
|
|
import RowsIconFilled from "~/components/ui/icons/entities/RowsIconFilled";
|
|
import TemplateIcon from "~/components/ui/icons/entities/TemplateIcon";
|
|
import TemplateIconFilled from "~/components/ui/icons/entities/TemplateIconFilled";
|
|
import ExperimentIcon from "~/components/ui/icons/tests/ExperimentIcon";
|
|
import ExperimentIconFilled from "~/components/ui/icons/tests/ExperimentIconFilled";
|
|
import SidebarIconsLayout from "~/components/ui/layouts/SidebarIconsLayout";
|
|
import { getTranslations } from "~/locale/i18next.server";
|
|
import { adminPath } from "~/utils/app/CanonicalUrlUtils";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
type LoaderData = {
|
|
title: string;
|
|
};
|
|
|
|
export const loader = async ({ request }: LoaderFunctionArgs) => {
|
|
const { t } = await getTranslations(request);
|
|
const data: LoaderData = {
|
|
title: `${t("models.entity.plural")} | ${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("models.entity.plural"),
|
|
href: adminPath("entities", { mode: "host-aware" }),
|
|
icon: <ModulesIcon className="h-5 w-5" />,
|
|
iconSelected: <ModulesIconFilled className="h-5 w-5" />,
|
|
exact: true,
|
|
},
|
|
{
|
|
name: t("models.entityGroup.plural"),
|
|
href: adminPath("entities/groups", { mode: "host-aware" }),
|
|
icon: <FolderIcon className="h-5 w-5" />,
|
|
iconSelected: <FolderIconFilled className="h-5 w-5" />,
|
|
},
|
|
{
|
|
name: t("models.formula.plural"),
|
|
href: adminPath("entities/formulas", { mode: "host-aware" }),
|
|
icon: <ExperimentIcon className="h-5 w-5" />,
|
|
iconSelected: <ExperimentIconFilled className="h-5 w-5" />,
|
|
},
|
|
{
|
|
name: t("models.entity.rows"),
|
|
href: adminPath("entities/rows", { mode: "host-aware" }),
|
|
icon: <RowsIcon className="h-5 w-5" />,
|
|
iconSelected: <RowsIconFilled className="h-5 w-5" />,
|
|
},
|
|
{
|
|
name: t("models.view.plural"),
|
|
href: adminPath("entities/views", { mode: "host-aware" }),
|
|
icon: <ViewBoardsEmptyIcon className="h-5 w-5" />,
|
|
iconSelected: <ViewBoardsIcon className="h-5 w-5" />,
|
|
},
|
|
{
|
|
name: t("models.log.plural"),
|
|
href: adminPath("entities/logs", { mode: "host-aware" }),
|
|
icon: <ActivityHistoryIcon className="h-5 w-5" />,
|
|
iconSelected: <ActivityHistoryIconFilled className="h-5 w-5" />,
|
|
},
|
|
{
|
|
name: t("models.entity.noCode.menu"),
|
|
href: adminPath("entities/no-code", { mode: "host-aware" }),
|
|
icon: <CodingIcon className="h-5 w-5" />,
|
|
iconSelected: <CodingIconFilled className="h-5 w-5" />,
|
|
},
|
|
{
|
|
name: t("models.entity.codeGenerator.menu"),
|
|
href: adminPath("entities/code-generator", { mode: "host-aware" }),
|
|
icon: <CodingIcon className="h-5 w-5" />,
|
|
iconSelected: <CodingIconFilled className="h-5 w-5" />,
|
|
},
|
|
{
|
|
name: t("models.entity.api"),
|
|
href: adminPath("entities/api", { mode: "host-aware" }),
|
|
icon: <RestApiIcon className="h-5 w-5" />,
|
|
iconSelected: <RestApiIconFilled className="h-5 w-5" />,
|
|
},
|
|
{
|
|
name: t("models.entityTemplate.plural"),
|
|
href: adminPath("entities/templates", { mode: "host-aware" }),
|
|
icon: <TemplateIcon className="h-5 w-5" />,
|
|
iconSelected: <TemplateIconFilled className="h-5 w-5" />,
|
|
bottom: true,
|
|
},
|
|
// {
|
|
// name: "Code",
|
|
// href: adminPath("entities/code", { mode: "host-aware" }),
|
|
// icon: <CodeFileIcon className="h-5 w-5" />,
|
|
// iconSelected: <CodeFileIconFilled className="h-5 w-5" />,
|
|
// bottom: true,
|
|
// },
|
|
]}
|
|
>
|
|
<Outlet />
|
|
</SidebarIconsLayout>
|
|
);
|
|
};
|