Add admin setup page
This commit is contained in:
@@ -3,7 +3,7 @@ import LinkList from "@/src/components/twui/elements/LinkList";
|
||||
import Stack from "@/src/components/twui/layout/Stack";
|
||||
import { AppContext } from "@/src/pages/__root";
|
||||
import { useContext } from "react";
|
||||
import { LayoutDashboard, LogOut, Server, Settings, Users } from "lucide-react";
|
||||
import { LayoutDashboard, LogOut, Server, Settings, Users, Wrench } from "lucide-react";
|
||||
|
||||
const sectionLabel = (label: string) => (
|
||||
<div className="px-3 pt-6 pb-1.5 text-[11.5px] font-semibold uppercase tracking-[0.08em] text-foreground-light/40 dark:text-foreground-dark/40">
|
||||
@@ -27,6 +27,9 @@ export default function AdminAsideLinks() {
|
||||
return null;
|
||||
}
|
||||
|
||||
const is_super_admin =
|
||||
user_types?.find((t) => t.user_type === "super_admin") !== undefined;
|
||||
|
||||
const links: TWUILink[] = [
|
||||
{ component: sectionLabel("Overview") },
|
||||
{
|
||||
@@ -54,6 +57,22 @@ export default function AdminAsideLinks() {
|
||||
url: "/admin/clients",
|
||||
icon: <Users size={16} strokeWidth={2} className={iconClassName} />,
|
||||
},
|
||||
{ component: sectionLabel("System") },
|
||||
...(is_super_admin
|
||||
? [
|
||||
{
|
||||
title: "Setup",
|
||||
url: "/admin/setup",
|
||||
icon: (
|
||||
<Wrench
|
||||
size={16}
|
||||
strokeWidth={2}
|
||||
className={iconClassName}
|
||||
/>
|
||||
),
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{ component: sectionLabel("Account") },
|
||||
{
|
||||
title: "Settings",
|
||||
|
||||
Reference in New Issue
Block a user