31 lines
1.0 KiB
TypeScript
31 lines
1.0 KiB
TypeScript
/**
|
|
* Admin parent route for the marketing-funnel lead inbox
|
|
* (Phase 05 Task #78, layer 4).
|
|
*
|
|
* Renders an `<Outlet />` for the index list view and the detail view at
|
|
* `/admin/marketing-leads/:id`. Permission is checked at the loader level
|
|
* so child loaders inherit the auth gate.
|
|
*/
|
|
import { LoaderFunctionArgs, MetaFunction, Outlet } from "react-router";
|
|
import { getTranslations } from "~/locale/i18next.server";
|
|
import { verifyUserHasPermission } from "~/utils/helpers/.server/PermissionsService";
|
|
|
|
type LoaderData = {
|
|
title: string;
|
|
};
|
|
|
|
export const loader = async ({ request }: LoaderFunctionArgs) => {
|
|
await verifyUserHasPermission(request, "admin.marketing.leads.view");
|
|
const { t } = await getTranslations(request);
|
|
const data: LoaderData = {
|
|
title: `${t("admin.marketingLeads.title")} | ${process.env.APP_NAME}`,
|
|
};
|
|
return data;
|
|
};
|
|
|
|
export const meta: MetaFunction<typeof loader> = ({ data }) => [{ title: data?.title }];
|
|
|
|
export default function MarketingLeadsLayout() {
|
|
return <Outlet />;
|
|
}
|