From cdb40ca671a85704f751179d13277a7db816b569 Mon Sep 17 00:00:00 2001
From: Owen Jacobson <owen@grimoire.ca>
Date: Tue, 29 Oct 2024 23:53:23 -0400
Subject: Incrementally less jank invite listing.

---
 ui/lib/components/Invites.svelte | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 ui/lib/components/Invites.svelte

(limited to 'ui/lib/components/Invites.svelte')

diff --git a/ui/lib/components/Invites.svelte b/ui/lib/components/Invites.svelte
new file mode 100644
index 0000000..df51afb
--- /dev/null
+++ b/ui/lib/components/Invites.svelte
@@ -0,0 +1,28 @@
+<script>
+	import { writable } from 'svelte/store';
+	import { createInvite } from '$lib/apiServer';
+	import Invite from '$lib/components/Invite.svelte';
+
+	let invites = writable([]);
+	$: $invites, console.log("invites", $invites);
+
+	async function onSubmit() {
+		let response = await createInvite();
+		if (response.status == 200) {
+			invites.update(val => [...val, response.data]);
+		}
+	}
+</script>
+
+<ul>
+	{#each $invites as invite}
+	<li><Invite id={invite.id} /></li>
+	{/each}
+</ul>
+<form on:submit|preventDefault={onSubmit}>
+	<button
+		class="btn variant-filled"
+		type="submit">
+		Create Invitation
+	</button>
+</form>
-- 
cgit v1.2.3

