diff --git a/frontend/src/lib/components/ui/badge/badge.svelte b/frontend/src/lib/components/ui/badge/badge.svelte
new file mode 100644
index 0000000..58ec3b0
--- /dev/null
+++ b/frontend/src/lib/components/ui/badge/badge.svelte
@@ -0,0 +1,18 @@
+
+
+
+
+
diff --git a/frontend/src/lib/components/ui/badge/index.ts b/frontend/src/lib/components/ui/badge/index.ts
new file mode 100644
index 0000000..2824b56
--- /dev/null
+++ b/frontend/src/lib/components/ui/badge/index.ts
@@ -0,0 +1,22 @@
+import { tv, type VariantProps } from "tailwind-variants";
+export { default as Badge } from "./badge.svelte";
+
+export const badgeVariants = tv({
+ base: "inline-flex items-center border rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none select-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
+ variants: {
+ variant: {
+ default:
+ "bg-primary hover:bg-primary/80 border-transparent text-primary-foreground",
+ secondary:
+ "bg-secondary hover:bg-secondary/80 border-transparent text-secondary-foreground",
+ destructive:
+ "bg-destructive hover:bg-destructive/80 border-transparent text-destructive-foreground",
+ outline: "text-foreground"
+ }
+ },
+ defaultVariants: {
+ variant: "default"
+ }
+});
+
+export type Variant = VariantProps["variant"];
diff --git a/frontend/src/routes/(app)/links/+page.server.ts b/frontend/src/routes/(app)/links/+page.server.ts
index c4b3da1..6831290 100644
--- a/frontend/src/routes/(app)/links/+page.server.ts
+++ b/frontend/src/routes/(app)/links/+page.server.ts
@@ -35,9 +35,7 @@ export const load = (async (event) => {
where: (shortener, { eq, and, isNull }) =>
and(
eq(shortener.userId, user.id),
- project_id
- ? eq(shortener.projectId, project_id)
- : isNull(shortener.projectId),
+ project_id ? eq(shortener.projectId, project_id) : undefined,
),
})
diff --git a/frontend/src/routes/(app)/links/+page.svelte b/frontend/src/routes/(app)/links/+page.svelte
index 6a78d09..3ac60a4 100644
--- a/frontend/src/routes/(app)/links/+page.svelte
+++ b/frontend/src/routes/(app)/links/+page.svelte
@@ -8,6 +8,7 @@
import * as Select from '$lib/components/ui/select'
import { Input } from '$lib/components/ui/input'
import { Label } from '$lib/components/ui/label'
+ import { Badge } from '$lib/components/ui/badge'
import {
BarChart,
ExternalLink,
@@ -155,17 +156,23 @@
{#each data.shorteners as shortener}
-
-
- {data.shortener_url + '/' + shortener.code}
-
-
+
+
+ {shortener.project
+ ? shortener.project.name
+ : 'Uncategorized'}
{shortener.link}