| 1 | import { notFound } from "next/navigation"; |
| 2 | |
| 3 | import { createServerClient } |
| 4 | import { ogCard, plural |
| 5 | |
| 6 | export { size, contentType |
| 7 | export const alt = |
| 8 | |
| 9 | export default async function |
| 10 | params, |
| 11 | }: { |
| 12 | params: Promise |
| 13 | }) { |
| 14 | const { username, |
| 15 | |
| 16 | const client = |
| 17 | const { data |
| 18 | "/api/repositories/{username}/{repo}/issues/{number}", |
| 19 | { params: { path: |
| 20 | ); |
| 21 | |
| 22 | if (!data) |
| 23 | |
| 24 | const open = |
| 25 | |
| 26 | return ogCard({ |
| 27 | eyebrow: `${username} |
| 28 | icon: open ? |
| 29 | badge: { label: data |
| 30 | title: data.title |
| 31 | description: data.body |
| 32 | stats: [ |
| 33 | { icon: "user", |
| 34 | { icon: "messageSquare", |
| 35 | ...(data.labels |
| 36 | ? [ |
| 37 | { |
| 38 | icon: "bookMarked" as |
| 39 | label: plural(data |
| 40 | }, |
| 41 | ] |
| 42 | : []), |
| 43 | ], |
| 44 | }); |
| 45 | } |