<script lang="ts">
	import { onMount } from 'svelte';
	import { getForms } from '../lib/api';
	import type { Form } from '../lib/types';

	let forms: any;

	onMount(async () => {
		forms = await getForms();
	});
</script>

<h1>Form Management Tool</h1>

<a href="/create">Create a New Form</a>

<ul>
	{#each forms as form}
		<li>
			<a href={`/form/${form.id}`}>{form.name}</a>
		</li>
	{/each}
</ul>
