|
5 | 5 | import { Button, buttonVariants } from '$lib/components/ui/button/index.js'; |
6 | 6 | import { Drawer } from 'vaul-svelte'; |
7 | 7 | import { toast } from 'svelte-sonner'; |
| 8 | + import { Badge } from '$lib/components/ui/badge/index.js'; |
| 9 | + import { badgeVariants } from '$lib/components/ui/badge/index.js'; |
8 | 10 |
|
9 | 11 | // Icons |
10 | 12 | import Refresh from 'lucide-svelte/icons/refresh-cw'; |
|
13 | 15 | import Share from 'lucide-svelte/icons/share'; |
14 | 16 | import Bookmark from 'lucide-svelte/icons/bookmark'; |
15 | 17 | import Comment from 'lucide-svelte/icons/message-square'; |
| 18 | + import ArrowRight from 'lucide-svelte/icons/arrow-right'; |
16 | 19 |
|
17 | 20 | // App imports |
18 | 21 | import { getGameById } from '$lib/gmaes'; |
19 | 22 | import { preferencesStore, favoritesStore, historyStore } from '$lib/stores'; |
20 | 23 | import { onMount } from 'svelte'; |
| 24 | + import clsx from 'clsx'; |
21 | 25 |
|
22 | 26 | function openNewTab(url: string) { |
23 | 27 | url = location.origin + url; |
|
60 | 64 | <iframe src={gmaedata?.url} frameborder="0" class="flex-grow rounded" title={gmaedata?.name} |
61 | 65 | ></iframe> |
62 | 66 |
|
63 | | - <div class="flex h-full w-72 flex-col"> |
| 67 | + <div class="flex h-full w-72 flex-col gap-2"> |
| 68 | + <a href="/" class={clsx(badgeVariants({ variant: 'secondary' }), 'w-fit')} |
| 69 | + >{gmaedata?.category}<ArrowRight class="ml-1 size-3" /></a |
| 70 | + > |
64 | 71 | <h1 class="text-4xl font-bold">{gmaedata?.name}</h1> |
| 72 | + <div class="flex w-full flex-row flex-wrap gap-2"> |
| 73 | + {#each gmaedata?.tags || [] as tag} |
| 74 | + <Badge variant="default">#{tag}</Badge> |
| 75 | + {/each} |
| 76 | + {#each gmaedata?.links || [] as link} |
| 77 | + <a href={link.url} target="_blank" class={badgeVariants({ variant: 'outline' })}> |
| 78 | + <OpenInNewTab class="mr-1 size-3" />{link.name} |
| 79 | + </a> |
| 80 | + {/each} |
| 81 | + </div> |
65 | 82 | <p class="text-xl">{gmaedata?.description}</p> |
66 | 83 | <div class="flex-grow"></div> |
67 | 84 | <div class="flex flex-col gap-3"> |
|
0 commit comments