| 1 | import { notFound } from "next/navigation"; |
| 2 | |
| 3 | import { SettingsNav } |
| 4 | import { getViewerRole } |
| 5 | import { atLeast } |
| 6 | |
| 7 | export default async function |
| 8 | params, |
| 9 | children, |
| 10 | }: LayoutProps< |
| 11 | const { username, |
| 12 | const role = |
| 13 | |
| 14 | // The API enforces every change; this keeps everyone else from seeing forms they cannot submit. |
| 15 | if (!atLeast(role |
| 16 | const base = |
| 17 | |
| 18 | return ( |
| 19 | <div className="grid gap-6 md:grid-cols-[200px_minmax(0,1fr)] md:gap-10 |
| 20 | <SettingsNav |
| 21 | label="Repository settings" |
| 22 | links={[ |
| 23 | { href: base, |
| 24 | ...(atLeast(role |
| 25 | ? [ |
| 26 | { |
| 27 | href: `${base} |
| 28 | label: "Access", |
| 29 | icon: "users" as |
| 30 | }, |
| 31 | { |
| 32 | href: `${base} |
| 33 | label: "Webhooks", |
| 34 | icon: "webhooks" as |
| 35 | }, |
| 36 | ] |
| 37 | : []), |
| 38 | ]} |
| 39 | /> |
| 40 | <div className="min-w-0 max-w-3xl |
| 41 | </div> |
| 42 | ); |
| 43 | } |