feat: margins

This commit is contained in:
Elias Renman
2025-03-25 12:44:07 +01:00
parent 2a5c3c4154
commit 7706cb96c4
2 changed files with 31 additions and 29 deletions

View File

@@ -8,7 +8,7 @@
</script>
<QueryClientProvider client={queryClient}>
<main class="p-4">
<main>
{#if cookies.includes("access_token")}
<Home />
{:else}

View File

@@ -6,35 +6,37 @@
const urls = queryUrls();
</script>
<Navbar />
<div class="p-4">
<Navbar />
<div class="max-w-3xl mx-auto p-4">
<h1 class="text-2xl font-bold mb-4">URL Shortener</h1>
<div class="max-w-3xl mx-auto m-4">
<h1 class="text-2xl font-bold mb-4">URL Shortener</h1>
<!-- Table -->
<div class="bg-gray-800 text-white rounded-lg shadow-lg overflow-hidden">
{#if $urls.isLoading}
<p>Loading...</p>
{:else if $urls.isError}
<p>Error: {$urls.error.message}</p>
{:else if $urls.isSuccess}
<table class="w-full text-left">
<thead class="bg-gray-900">
<tr>
<th class="p-3">Shortform</th>
<th class="p-3">Destination</th>
<th class="p-3">Expires at</th>
<th class="p-3">Actions</th>
</tr>
</thead>
<tbody>
{#each $urls.data.data as row}
<Row {row} />
{/each}
</tbody>
</table>
{/if}
<!-- Table -->
<div class="bg-gray-800 text-white rounded-lg shadow-lg overflow-hidden">
{#if $urls.isLoading}
<p>Loading...</p>
{:else if $urls.isError}
<p>Error: {$urls.error.message}</p>
{:else if $urls.isSuccess}
<table class="w-full text-left">
<thead class="bg-gray-900">
<tr>
<th class="p-3">Shortform</th>
<th class="p-3">Destination</th>
<th class="p-3">Expires at</th>
<th class="p-3">Actions</th>
</tr>
</thead>
<tbody>
{#each $urls.data.data as row}
<Row {row} />
{/each}
</tbody>
</table>
{/if}
</div>
<Create />
</div>
<Create />
</div>