|
26 | 26 | ChevronLeft, |
27 | 27 | FileDiff, |
28 | 28 | GitCommitVertical, |
| 29 | + Info, |
29 | 30 | Lock, |
30 | 31 | MessagesSquare |
31 | 32 | } from "@lucide/svelte"; |
|
42 | 43 | PullRequestDetails |
43 | 44 | } from "$lib/server/github-cache"; |
44 | 45 | import * as Accordion from "$lib/components/ui/accordion"; |
| 46 | + import * as Alert from "$lib/components/ui/alert"; |
45 | 47 | import * as Avatar from "$lib/components/ui/avatar"; |
46 | 48 | import { Badge } from "$lib/components/ui/badge"; |
47 | 49 | import { Button } from "$lib/components/ui/button"; |
|
129 | 131 | commits: PullRequestDetails["commits"]; |
130 | 132 | files: PullRequestDetails["files"]; |
131 | 133 | linkedEntities: LinkedItem[]; |
| 134 | + mergedTagName: Promise<string | undefined>; |
132 | 135 | }; |
133 | 136 |
|
134 | | - let { metadata, info, comments, commits, files, linkedEntities }: Props = $props(); |
| 137 | + let { metadata, info, comments, commits, files, linkedEntities, mergedTagName }: Props = $props(); |
135 | 138 |
|
136 | 139 | let rightPartInfo = $derived<{ title: string; value: string }[]>([ |
137 | 140 | ...("answer_chosen_at" in info && info.answer_chosen_at |
|
363 | 366 | </div> |
364 | 367 | <div class="mt-4 flex flex-col gap-4"> |
365 | 368 | <!-- Info --> |
366 | | - <div |
367 | | - class="mb-8 flex w-full flex-col justify-center gap-8 *:h-fit *:rounded-md *:border md:flex-row" |
368 | | - > |
| 369 | + <div class="mb-8 flex w-full flex-col justify-center gap-8 *:h-fit md:flex-row"> |
369 | 370 | <!-- Left part - body --> |
370 | | - <div class="flex-1 bg-muted/30"> |
| 371 | + <div class="flex-1 rounded-md border bg-muted/30"> |
371 | 372 | <!-- Author --> |
372 | 373 | <div |
373 | 374 | class="inline-flex w-full flex-col gap-1 border-b bg-muted/60 px-4 py-2 xs:flex-row xs:items-center xs:gap-0" |
|
409 | 410 | </div> |
410 | 411 | </div> |
411 | 412 | <!-- Right part - info --> |
412 | | - <div class="px-4 pb-3 md:w-2/5 md:max-w-xs md:min-w-72"> |
413 | | - <h4 class="-mx-4 mb-4 border-b bg-muted/40 px-4 pt-2 pb-1 text-xl font-semibold">Info</h4> |
414 | | - {#each rightPartInfo as { title, value }, i (title)} |
415 | | - {#if i > 0} |
416 | | - <Separator class="my-2" /> |
| 413 | + <div class="flex flex-col gap-4 md:w-2/5 md:max-w-xs md:min-w-72"> |
| 414 | + <div class="rounded-md border px-4 pb-3"> |
| 415 | + <h4 class="-mx-4 mb-4 border-b bg-muted/40 px-4 pt-2 pb-1 text-xl font-semibold">Info</h4> |
| 416 | + {#each rightPartInfo as { title, value }, i (title)} |
| 417 | + {#if i > 0} |
| 418 | + <Separator class="my-2" /> |
| 419 | + {/if} |
| 420 | + <div class="flex items-center justify-between gap-2"> |
| 421 | + <span class="font-medium">{title}</span> |
| 422 | + <span class="text-right text-muted-foreground">{value}</span> |
| 423 | + </div> |
| 424 | + {/each} |
| 425 | + </div> |
| 426 | + {#await mergedTagName then tagName} |
| 427 | + {#if tagName} |
| 428 | + <Alert.Root class="rounded-md border-green-500 bg-green-400/10"> |
| 429 | + <Info class="size-4" /> |
| 430 | + <Alert.Description class="inline text-foreground"> |
| 431 | + This pull request was merged in |
| 432 | + <Button |
| 433 | + variant="link" |
| 434 | + href="https://github.com/{metadata.org}/{metadata.repo}/releases/tag/{tagName}" |
| 435 | + target="_blank" |
| 436 | + class="group h-auto gap-0.5 p-0 text-green-500 has-[>svg]:px-0" |
| 437 | + > |
| 438 | + {tagName} |
| 439 | + <ArrowUpRight |
| 440 | + class="-translate-x-2 opacity-0 transition group-hover:translate-x-0 group-hover:opacity-100" |
| 441 | + /> |
| 442 | + </Button> |
| 443 | + </Alert.Description> |
| 444 | + </Alert.Root> |
417 | 445 | {/if} |
418 | | - <div class="flex items-center justify-between gap-2"> |
419 | | - <span class="font-medium">{title}</span> |
420 | | - <span class="text-right text-muted-foreground">{value}</span> |
421 | | - </div> |
422 | | - {/each} |
| 446 | + {/await} |
423 | 447 | </div> |
424 | 448 | </div> |
425 | 449 | <!-- Comments --> |
|
0 commit comments