| 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 | const STATE_COLOR = { |
| 10 | open: "#7dd3a0", |
| 11 | closed: "#e8a3a3", |
| 12 | merged: "#b9a6f7", |
| 13 | } as const; |
| 14 | |
| 15 | export default async function |
| 16 | params, |
| 17 | }: { |
| 18 | params: Promise |
| 19 | }) { |
| 20 | const { username, |
| 21 | |
| 22 | const client = |
| 23 | const { data |
| 24 | "/api/repositories/{username}/{repo}/pulls/{number}", |
| 25 | { params: { path: |
| 26 | ); |
| 27 | |
| 28 | if (!data) |
| 29 | |
| 30 | return ogCard({ |
| 31 | eyebrow: `${username} |
| 32 | icon: data.state |
| 33 | badge: { label: data |
| 34 | title: data.title |
| 35 | description: `${data. |
| 36 | stats: [ |
| 37 | { icon: "user", |
| 38 | { |
| 39 | icon: "gitCommitHorizontal", |
| 40 | label: plural(data |
| 41 | }, |
| 42 | { icon: "fileDiff", |
| 43 | ], |
| 44 | }); |
| 45 | } |