2022-08-29 03:48:29 +00:00
|
|
|
<script lang="ts">
|
2024-09-16 16:07:22 +00:00
|
|
|
import * as Card from '$components/ui/card'
|
|
|
|
|
const { data } = $props()
|
|
|
|
|
let collections = data?.collections || []
|
2022-08-29 03:48:29 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<svelte:head>
|
2024-04-17 19:02:51 +00:00
|
|
|
<title>Your Collections | Bored Game</title>
|
2022-08-29 03:48:29 +00:00
|
|
|
</svelte:head>
|
|
|
|
|
|
2024-09-16 16:07:22 +00:00
|
|
|
<div class="container">
|
2024-04-17 19:02:51 +00:00
|
|
|
<h1>Your Collections</h1>
|
2022-08-29 03:48:29 +00:00
|
|
|
|
2024-04-17 19:02:51 +00:00
|
|
|
<div class="collection-list">
|
|
|
|
|
{#if collections.length === 0}
|
|
|
|
|
<h2>You have no collections</h2>
|
2022-10-27 03:49:58 +00:00
|
|
|
{:else}
|
2024-04-17 19:02:51 +00:00
|
|
|
{#each collections as collection}
|
2024-09-16 16:07:22 +00:00
|
|
|
<Card.Root>
|
|
|
|
|
<Card.Header>
|
|
|
|
|
<Card.Title>{collection.name}</Card.Title>
|
|
|
|
|
</Card.Header>
|
|
|
|
|
<Card.Content>
|
|
|
|
|
<p>Number of items:</p>
|
|
|
|
|
<p>Created at: {new Date(collection.createdAt).toLocaleString()}</p>
|
|
|
|
|
</Card.Content>
|
|
|
|
|
</Card.Root>
|
|
|
|
|
<!-- <div class="collection grid gap-0.5">
|
2024-04-17 19:02:51 +00:00
|
|
|
<h2><a href="/collections/{collection.cuid}">{collection.name}</a></h2>
|
2024-09-16 16:07:22 +00:00
|
|
|
<h3>Created at: {new Date(collection.createdAt).toLocaleString()}</h3>
|
|
|
|
|
</div> -->
|
2022-10-27 03:49:58 +00:00
|
|
|
{/each}
|
|
|
|
|
{/if}
|
|
|
|
|
</div>
|
2023-07-18 21:23:45 +00:00
|
|
|
</div>
|
2022-08-29 03:48:29 +00:00
|
|
|
|
2023-06-16 06:28:49 +00:00
|
|
|
<style lang="postcss">
|
2022-10-27 03:49:58 +00:00
|
|
|
h1 {
|
2024-04-17 19:02:51 +00:00
|
|
|
margin: 1.5rem 0;
|
2022-10-27 03:49:58 +00:00
|
|
|
width: 100%;
|
|
|
|
|
}
|
2022-08-29 03:48:29 +00:00
|
|
|
|
2024-04-17 19:02:51 +00:00
|
|
|
.collection-list {
|
2022-10-27 03:49:58 +00:00
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(3, minmax(200px, 1fr));
|
|
|
|
|
gap: 2rem;
|
2022-08-29 03:48:29 +00:00
|
|
|
|
2022-10-27 03:49:58 +00:00
|
|
|
@media (max-width: 800px) {
|
|
|
|
|
grid-template-columns: 1fr 1fr;
|
|
|
|
|
}
|
2022-08-29 03:48:29 +00:00
|
|
|
|
2022-10-27 03:49:58 +00:00
|
|
|
@media (max-width: 550px) {
|
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-08-29 03:48:29 +00:00
|
|
|
</style>
|