update shortener card

pull/3/head
TZGyn 2 years ago
parent 362432d6e1
commit b656a4ca49
Signed by: TZGyn
GPG Key ID: 122EAF77AE81FD4A

@ -9,12 +9,12 @@
import { Label } from '$lib/components/ui/label' import { Label } from '$lib/components/ui/label'
import { import {
BarChart, BarChart,
Link2, ExternalLink,
Loader2, Loader2,
MoreVertical, MoreVertical,
PlusCircle, PlusCircle,
} from 'lucide-svelte' } from 'lucide-svelte'
import { invalidateAll } from '$app/navigation' import { goto, invalidateAll } from '$app/navigation'
export let data: PageData export let data: PageData
@ -110,7 +110,7 @@
<Separator /> <Separator />
{#if data.shorteners.length > 0} {#if data.shorteners.length > 0}
<div class="flex flex-col gap-4 p-4"> <div class="flex flex-col gap-4 overflow-scroll p-4">
{#each data.shorteners as shortener} {#each data.shorteners as shortener}
<Card.Root class="w-full max-w-[500px]"> <Card.Root class="w-full max-w-[500px]">
<Card.Header> <Card.Header>
@ -124,20 +124,21 @@
class="hover:underline"> class="hover:underline">
{data.shortener_url + '/' + shortener.code} {data.shortener_url + '/' + shortener.code}
</a> </a>
<Link2 /> <ExternalLink size={16} />
</Card.Title> </Card.Title>
<Card.Description>{shortener.link}</Card.Description> <Card.Description>{shortener.link}</Card.Description>
</Card.Header> </Card.Header>
<Card.Content> <Card.Content>
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<div class="flex gap-2"> <div class="flex gap-2">
<div <Button
class="flex items-center justify-center gap-1 rounded bg-secondary px-3 py-1 text-sm"> class="flex h-8 items-center justify-center gap-1 rounded bg-secondary text-sm"
on:click={() => goto(`/links/${shortener.code}`)}>
<BarChart size={20} /> <BarChart size={20} />
<div> <div>
{shortener.visitor.length} visits {shortener.visitor.length} visits
</div> </div>
</div> </Button>
</div> </div>
<DropdownMenu.Root> <DropdownMenu.Root>
<DropdownMenu.Trigger> <DropdownMenu.Trigger>

Loading…
Cancel
Save