29 lines
888 B
TypeScript
29 lines
888 B
TypeScript
import { LoaderFunctionArgs, MetaFunction } from "react-router";
|
|
import { Outlet } from "react-router";
|
|
import { useTranslation } from "react-i18next";
|
|
import { AdminPageHeader } from "~/components/screens/admin/AdminPageHeader";
|
|
import { requestScopedT as i18nT } from "~/locale/request-scoped-t";
|
|
|
|
type LoaderData = {
|
|
title: string;
|
|
};
|
|
|
|
export const loader = async (_: LoaderFunctionArgs) => {
|
|
const data: LoaderData = {
|
|
title: i18nT("admin.api.metaTitle", { appName: process.env.APP_NAME }),
|
|
};
|
|
return data;
|
|
};
|
|
|
|
export const meta: MetaFunction<typeof loader> = ({ data }) => [{ title: data?.title }];
|
|
|
|
export default function AdminApiShell() {
|
|
const { t } = useTranslation();
|
|
return (
|
|
<div className="flex w-full flex-col">
|
|
<AdminPageHeader title={t("admin.apiAdmin.title")} description={t("admin.apiAdmin.description")} />
|
|
<Outlet />
|
|
</div>
|
|
);
|
|
}
|