<script lang="ts">
	import type { PageData } from "./$types";
	export let data: PageData;

	import User from "../User.svelte";
</script>

<h1>{data.title}</h1>

{#if !data.error}
	{#if data.users.users.length > 0}
		<div class="flex flex-row flex-wrap gap-4">
			{#each data.users.users as user}
				<User {user} />
			{/each}
		</div>
	{:else}
		<p>No users</p>
	{/if}
{:else}
	<p>{data.message}</p>
{/if}