| 1 | import { notFound } from "next/navigation"; |
| 2 | |
| 3 | import { LabelManager } |
| 4 | import { createServerClient, getViewerRole |
| 5 | import { atLeast } |
| 6 | |
| 7 | export default async function |
| 8 | params, |
| 9 | }: PageProps< |
| 10 | const { username, |
| 11 | |
| 12 | const [role, |
| 13 | getViewerRole(username, repo |
| 14 | createServerClient(), |
| 15 | ]); |
| 16 | |
| 17 | const labels = |
| 18 | "/api/repositories/{username}/{repo}/labels", |
| 19 | { params: { path: |
| 20 | ); |
| 21 | |
| 22 | if (labels.response |
| 23 | if (!labels.data |
| 24 | throw new Error( |
| 25 | } |
| 26 | |
| 27 | return ( |
| 28 | <LabelManager |
| 29 | username={username} |
| 30 | repo={repo} |
| 31 | labels={labels.data |
| 32 | canEdit={atLeast(role |
| 33 | /> |
| 34 | ); |
| 35 | } |