24 lines
904 B
TypeScript
24 lines
904 B
TypeScript
import { LoaderFunctionArgs, useLocation, useOutlet } from "react-router";
|
|
import { AdminSettingsShell } from "~/components/screens/admin/settings/AdminSettingsShell";
|
|
import { getTranslations } from "~/locale/i18next.server";
|
|
|
|
export const loader = async ({ request }: LoaderFunctionArgs) => {
|
|
const { t } = await getTranslations(request);
|
|
return Response.json({ title: t("app.sidebar.settings") });
|
|
};
|
|
|
|
export default function AdminSettings() {
|
|
const outlet = useOutlet();
|
|
const location = useLocation();
|
|
const childOwnsPageHeader = [
|
|
"/settings/pipelines",
|
|
"/settings/leads",
|
|
"/settings/fields-tags",
|
|
"/settings/telephony",
|
|
"/settings/admin-users",
|
|
"/settings/admin-roles",
|
|
].some((path) => location.pathname === path || location.pathname.startsWith(`${path}/`));
|
|
|
|
return <AdminSettingsShell withPageHeader={!childOwnsPageHeader}>{outlet}</AdminSettingsShell>;
|
|
}
|