<script lang="ts">
	import { Button, Label, Textarea } from 'flowbite-svelte';
	import RatingInput from './RatingInput.svelte';
	interface Rating {
		rating: number;
		comment: string;
	}
	let { rating }: { rating: Rating } = $props();
</script>

<form method="POST" class="flex flex-col gap-5">
	<div>
		<Label>Komentar</Label>
		<Textarea
			value={rating.comment}
			name="comment"
			required
			minlength={5}
			class="w-full min-h-40"
		/>
	</div>
	<div>
		<Label>Bewärtig</Label>
		<RatingInput value={rating.rating} name="rating" />
	</div>
	<Button type="submit" class="grow-0 self-end">Spichere</Button>
</form>
