32 lines
1.0 KiB
TypeScript
32 lines
1.0 KiB
TypeScript
/**
|
|
* Admin parent route for the email-sequence editor + dashboard
|
|
* (Phase 05 Task #80, deferred follow-up).
|
|
*
|
|
* Renders an `<Outlet />` for the list / detail / stats child routes.
|
|
* Permission gating happens here so all child loaders inherit the
|
|
* auth check.
|
|
*/
|
|
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 title = t("admin.emailSequences.title");
|
|
const data: LoaderData = {
|
|
title: `${title} | ${process.env.APP_NAME}`,
|
|
};
|
|
return data;
|
|
};
|
|
|
|
export const meta: MetaFunction<typeof loader> = ({ data }) => [{ title: data?.title }];
|
|
|
|
export default function EmailSequencesLayout() {
|
|
return <Outlet />;
|
|
}
|