|
|
|
@ -3,32 +3,35 @@
|
|
|
|
import * as Card from '$lib/components/ui/card'
|
|
|
|
import * as Card from '$lib/components/ui/card'
|
|
|
|
import { Button } from '$lib/components/ui/button'
|
|
|
|
import { Button } from '$lib/components/ui/button'
|
|
|
|
import { Separator } from '$lib/components/ui/separator'
|
|
|
|
import { Separator } from '$lib/components/ui/separator'
|
|
|
|
import { BarChart } from 'lucide-svelte'
|
|
|
|
import { BarChart, ExternalLink } from 'lucide-svelte'
|
|
|
|
|
|
|
|
|
|
|
|
export let data: PageData
|
|
|
|
export let data: PageData
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="flex min-h-[80px] items-center justify-between p-4">
|
|
|
|
<div class="flex flex-col gap-4 px-10 py-8">
|
|
|
|
<div class="text-3xl font-bold">Dashboard</div>
|
|
|
|
<h2 class="text-2xl font-bold tracking-tight">Projects</h2>
|
|
|
|
|
|
|
|
<Separator class="" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<Separator />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-wrap gap-4 p-4">
|
|
|
|
<div class="flex w-full flex-col items-stretch gap-2 px-6">
|
|
|
|
<Card.Root class="w-[500px]">
|
|
|
|
{#each data.projects as project}
|
|
|
|
|
|
|
|
<a href={'/links?project=' + project.uuid}>
|
|
|
|
|
|
|
|
<Card.Root
|
|
|
|
|
|
|
|
class="w-full max-w-[500px] hover:cursor-pointer hover:bg-secondary">
|
|
|
|
<Card.Header>
|
|
|
|
<Card.Header>
|
|
|
|
<Card.Title>Projects</Card.Title>
|
|
|
|
<Card.Title class="flex items-center gap-2">
|
|
|
|
<Card.Description>Projects</Card.Description>
|
|
|
|
{project.name}
|
|
|
|
|
|
|
|
</Card.Title>
|
|
|
|
</Card.Header>
|
|
|
|
</Card.Header>
|
|
|
|
<Card.Content>
|
|
|
|
<Card.Content>
|
|
|
|
<div class="flex w-full flex-col items-stretch gap-2">
|
|
|
|
<div class="flex w-full gap-4">
|
|
|
|
{#each data.projects as project}
|
|
|
|
|
|
|
|
<div class="flex w-full items-center justify-between gap-2">
|
|
|
|
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
href={'/links?project=' + project.uuid}
|
|
|
|
class="flex h-8 items-center justify-center gap-1 rounded bg-secondary text-sm">
|
|
|
|
class="w-3/4">
|
|
|
|
<ExternalLink size={20} />
|
|
|
|
{project.name}
|
|
|
|
{project.shortener.length}
|
|
|
|
|
|
|
|
Shorteners
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
<div class="flex gap-2">
|
|
|
|
<div class="flex items-center gap-2">
|
|
|
|
<BarChart />
|
|
|
|
<BarChart />
|
|
|
|
{project.shortener.reduce(
|
|
|
|
{project.shortener.reduce(
|
|
|
|
(curr, shortener) => shortener.visitor.length + curr,
|
|
|
|
(curr, shortener) => shortener.visitor.length + curr,
|
|
|
|
@ -36,8 +39,8 @@
|
|
|
|
)} visits
|
|
|
|
)} visits
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/each}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</Card.Content>
|
|
|
|
</Card.Content>
|
|
|
|
</Card.Root>
|
|
|
|
</Card.Root>
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
{/each}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|