| 1 | import { Skeleton } from "@/components/ui/skeleton"; |
| 2 | import { createServerClient } |
| 3 | |
| 4 | import { SubscribeButton } |
| 5 | |
| 6 | /** Renders nothing for a signed-out visitor, who has no subscription to change. */ |
| 7 | export async function ThreadSubscription |
| 8 | username, |
| 9 | repo, |
| 10 | number, |
| 11 | }: { |
| 12 | username: string |
| 13 | repo: string |
| 14 | number: number |
| 15 | }) { |
| 16 | const client = |
| 17 | const { data |
| 18 | "/api/repositories/{username}/{repo}/issues/{number}/subscription", |
| 19 | { params: { path: |
| 20 | ); |
| 21 | if (!data) |
| 22 | |
| 23 | return ( |
| 24 | <SubscribeButton |
| 25 | username={username} |
| 26 | repo={repo} |
| 27 | number={number} |
| 28 | subscribed={data.subscribed |
| 29 | /> |
| 30 | ); |
| 31 | } |
| 32 | |
| 33 | export function ThreadSubscriptionSkeleton() |
| 34 | return <Skeleton className |
| 35 | } |