<script lang="ts">

	import type { PageProps } from "./$types"
	import { enhance } from "$app/forms";

	const { data }: PageProps = $props();

	console.log(data)

</script>

<form method="GET" id="form_manage_user" action="user"></form>

<div>
	<h1>Benutzerverwaltung</h1>

	<select form="form_manage_user" name="user" size="10" required>
		{#each data.user as user (user.id)}
			<option value={user.id}>{user.username} | {user.name}</option>
		{/each}
	</select>
	<button type="submit" form="form_manage_user">Edit</button>
</div>

<style>
	div {
		position: absolute;
		top: 33%;
		left: 50%;
		transform: translate(-50%, -50%);
	}

	select {
		width: 100%;
	}

</style>
