1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-08-01 03:05:18 +02:00
AdventureLog/frontend/src/routes/search/+page.svelte

25 lines
624 B
Svelte
Raw Normal View History

2024-07-17 17:36:05 -04:00
<script lang="ts">
import AdventureCard from '$lib/components/AdventureCard.svelte';
import NotFound from '$lib/components/NotFound.svelte';
import type { Adventure } from '$lib/types';
import type { PageData } from './$types';
export let data: PageData;
console.log(data);
let adventures: Adventure[] = [];
if (data.props) {
adventures = data.props.adventures;
}
</script>
{#if adventures.length === 0}
<NotFound />
{:else}
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
{#each adventures as adventure}
<AdventureCard type={adventure.type} {adventure} />
{/each}
</div>
2024-07-17 17:36:05 -04:00
{/if}