| 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 | client.GET("/api/users/{username} |
| 19 | client.GET("/api/organizations/{slug} |
| 20 | params: { path: { |
| 21 | }), |
| 22 | ]); |
| 23 | |
| 24 | if (organization.data |
| 25 | const org = |
| 26 | return ogCard({ |
| 27 | eyebrow: "Organization", |
| 28 | icon: "user", |
| 29 | avatar: org.logo |
| 30 | title: org.name |
| 31 | description: `@${org |
| 32 | stats: [ |
| 33 | { |
| 34 | icon: "folder", |
| 35 | label: plural(org |
| 36 | }, |
| 37 | { |
| 38 | icon: "clock", |
| 39 | label: `since ${new |
| 40 | }, |
| 41 | ], |
| 42 | }); |
| 43 | } |
| 44 | if (!data) |
| 45 | return ogCard({ |
| 46 | eyebrow: "User Profile", |
| 47 | icon: "user", |
| 48 | avatar: data.image |
| 49 | title: data.name |
| 50 | description: `@${data |
| 51 | stats: [ |
| 52 | { |
| 53 | icon: "folder", |
| 54 | label: plural(data |
| 55 | }, |
| 56 | { icon: "star", |
| 57 | { |
| 58 | icon: "clock", |
| 59 | label: `joined ${new |
| 60 | }, |
| 61 | ], |
| 62 | }); |
| 63 | } |