83 lines
3.4 KiB
TypeScript
83 lines
3.4 KiB
TypeScript
import { LoaderFunctionArgs, MetaFunction } from "react-router";
|
|
import { Outlet } from "react-router";
|
|
import { useTranslation } from "react-i18next";
|
|
import ServerError from "~/components/ui/errors/ServerError";
|
|
import SidebarIconsLayout from "~/components/ui/layouts/SidebarIconsLayout";
|
|
import CustomerIcon from "~/components/ui/icons/settings/CustomerIcon";
|
|
import CompanyIcon from "~/components/ui/icons/crm/CompanyIcon";
|
|
import { LockIcon, NoSymbolIcon, ServerStackIcon } from "~/components/ui/icons/vendor";
|
|
import { adminPath } from "~/utils/app/CanonicalUrlUtils";
|
|
|
|
type LoaderData = {
|
|
title: string;
|
|
};
|
|
|
|
export const loader = async ({ request: _request, params: _params }: LoaderFunctionArgs) => {
|
|
const data: LoaderData = {
|
|
title: "",
|
|
};
|
|
return data;
|
|
};
|
|
|
|
export const meta: MetaFunction<typeof loader> = ({ data }) => [{ title: data?.title }];
|
|
|
|
export default () => {
|
|
const { t } = useTranslation();
|
|
return <Outlet />;
|
|
return (
|
|
<SidebarIconsLayout
|
|
label={{ align: "right" }}
|
|
items={[
|
|
{
|
|
name: t("admin.tenants.title"),
|
|
href: adminPath("accounts", { mode: "host-aware" }),
|
|
exact: true,
|
|
// permission: "admin.accounts.view",
|
|
icon: <CompanyIcon className="text-muted-foreground h-5 w-5 shrink-0" aria-hidden="true" />,
|
|
iconSelected: <CompanyIcon className="text-muted-foreground h-5 w-5 shrink-0" aria-hidden="true" />,
|
|
},
|
|
{
|
|
name: t("models.user.plural"),
|
|
href: adminPath("accounts/users", { mode: "host-aware" }),
|
|
// permission: "admin.users.view",
|
|
icon: <CustomerIcon className="text-muted-foreground h-5 w-5 shrink-0" aria-hidden="true" />,
|
|
iconSelected: <CustomerIcon className="text-muted-foreground h-5 w-5 shrink-0" aria-hidden="true" />,
|
|
},
|
|
{
|
|
name: t("app.sidebar.rolesAndPermissions"),
|
|
href: adminPath("accounts/roles-and-permissions", { mode: "host-aware" }),
|
|
// permission: "admin.roles.view",
|
|
icon: <LockIcon className="text-muted-foreground h-5 w-5 shrink-0" aria-hidden="true" />,
|
|
iconSelected: <LockIcon className="text-muted-foreground h-5 w-5 shrink-0" aria-hidden="true" />,
|
|
},
|
|
{
|
|
name: t("admin.accounts.navigation.subscriptions"),
|
|
href: adminPath("accounts/subscriptions", { mode: "host-aware" }),
|
|
// permission: "admin.relationships.view",
|
|
hidden: true,
|
|
},
|
|
{
|
|
name: t("models.blacklist.object"),
|
|
href: adminPath("accounts/blacklist", { mode: "host-aware" }),
|
|
// permission: "admin.blacklist.view",
|
|
icon: <NoSymbolIcon className="text-muted-foreground h-5 w-5 shrink-0" aria-hidden="true" />,
|
|
iconSelected: <NoSymbolIcon className="text-muted-foreground h-5 w-5 shrink-0" aria-hidden="true" />,
|
|
},
|
|
{
|
|
name: t("models.tenantIpAddress.plural"),
|
|
href: adminPath("accounts/ip-addresses", { mode: "host-aware" }),
|
|
// permission: "admin.tenantIpAddress.view",
|
|
icon: <ServerStackIcon className="text-muted-foreground h-5 w-5 shrink-0" aria-hidden="true" />,
|
|
iconSelected: <ServerStackIcon className="text-muted-foreground h-5 w-5 shrink-0" aria-hidden="true" />,
|
|
},
|
|
]}
|
|
>
|
|
<Outlet />
|
|
</SidebarIconsLayout>
|
|
);
|
|
};
|
|
|
|
export function ErrorBoundary() {
|
|
return <ServerError />;
|
|
}
|