2022-06-01 17:24:41 +00:00
|
|
|
import {
|
|
|
|
CreditCardIcon,
|
|
|
|
KeyIcon,
|
|
|
|
LockClosedIcon,
|
|
|
|
UserGroupIcon,
|
|
|
|
UserIcon,
|
|
|
|
CodeIcon,
|
|
|
|
} from "@heroicons/react/solid";
|
2022-05-26 17:07:14 +00:00
|
|
|
import React, { ComponentProps } from "react";
|
2021-09-29 21:33:18 +00:00
|
|
|
|
2022-05-26 17:07:14 +00:00
|
|
|
import ErrorBoundary from "@lib/ErrorBoundary";
|
2021-10-13 09:34:55 +00:00
|
|
|
|
2022-05-17 20:43:27 +00:00
|
|
|
import NavTabs from "./NavTabs";
|
2022-05-26 17:07:14 +00:00
|
|
|
import Shell from "./Shell";
|
2021-09-29 21:33:18 +00:00
|
|
|
|
2022-05-26 17:07:14 +00:00
|
|
|
const tabs = [
|
|
|
|
{
|
|
|
|
name: "profile",
|
|
|
|
href: "/settings/profile",
|
|
|
|
icon: UserIcon,
|
|
|
|
},
|
2022-06-01 17:24:41 +00:00
|
|
|
{
|
|
|
|
name: "teams",
|
|
|
|
href: "/settings/teams",
|
|
|
|
icon: UserGroupIcon,
|
|
|
|
},
|
2022-05-26 17:07:14 +00:00
|
|
|
{
|
|
|
|
name: "security",
|
|
|
|
href: "/settings/security",
|
|
|
|
icon: KeyIcon,
|
|
|
|
},
|
|
|
|
{
|
2022-06-01 17:24:41 +00:00
|
|
|
name: "developer",
|
|
|
|
href: "/settings/developer",
|
|
|
|
icon: CodeIcon,
|
2022-05-26 17:07:14 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "billing",
|
|
|
|
href: "/settings/billing",
|
|
|
|
icon: CreditCardIcon,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "admin",
|
|
|
|
href: "/settings/admin",
|
|
|
|
icon: LockClosedIcon,
|
|
|
|
adminRequired: true,
|
|
|
|
},
|
|
|
|
];
|
2021-09-29 21:33:18 +00:00
|
|
|
|
2022-05-26 17:07:14 +00:00
|
|
|
export default function SettingsShell({
|
|
|
|
children,
|
|
|
|
...rest
|
|
|
|
}: { children: React.ReactNode } & ComponentProps<typeof Shell>) {
|
2021-09-29 21:33:18 +00:00
|
|
|
return (
|
2022-05-26 17:07:14 +00:00
|
|
|
<Shell {...rest}>
|
2021-09-29 21:33:18 +00:00
|
|
|
<div className="sm:mx-auto">
|
|
|
|
<NavTabs tabs={tabs} />
|
|
|
|
</div>
|
2022-05-26 17:07:14 +00:00
|
|
|
<main className="max-w-4xl">
|
|
|
|
<>
|
|
|
|
<ErrorBoundary>{children}</ErrorBoundary>
|
|
|
|
</>
|
|
|
|
</main>
|
|
|
|
</Shell>
|
2021-09-29 21:33:18 +00:00
|
|
|
);
|
|
|
|
}
|