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/Invite.svelte | 41 +++++++----------------------------------
 1 file changed, 7 insertions(+), 34 deletions(-)

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

diff --git a/ui/lib/components/Invite.svelte b/ui/lib/components/Invite.svelte
index f4babad..7fdc753 100644
--- a/ui/lib/components/Invite.svelte
+++ b/ui/lib/components/Invite.svelte
@@ -1,40 +1,13 @@
 <script>
-	import { base } from '$app/paths';
-	import { createInvite } from '$lib/apiServer';
 	import { clipboard } from '@skeletonlabs/skeleton';
 
-	let invite = null;
-	$: inviteUrl = invite ? new URL(`/invite/${invite.id}`, document.location) : null;
-	$: inviteUrl, console.log("invite url", inviteUrl);
+	export let id;
+	$: inviteUrl = new URL(`/invite/${id}`, document.location);
+</script>
 
-	async function onSubmit() {
-		let response = await createInvite();
-		if (response.status == 200) {
-			invite = response.data;
-		}
-		console.log("base url", base);
-	}
+<button
+	class="border-slate-500 border-solid border-2 font-bold p-1 rounded"
+	use:clipboard={inviteUrl}>Copy</button>
+<span data-clipboard="inviteUrl">{inviteUrl}</span>
 
-	async function onReset() {
-		invite = null;
-	}
-</script>
 
-<form
-	on:submit|preventDefault={onSubmit}
-	on:reset|preventDefault={onReset}>
-	{#if inviteUrl}
-	<button
-		class="border-slate-500 border-solid border-2 font-bold p-1 rounded"
-		use:clipboard={inviteUrl}
-		type="reset">
-		Copy Invite
-	</button>
-	{:else}
-	<button
-		class="border-slate-500 border-solid border-2 font-bold p-1 rounded"
-		type="submit">
-		Invite
-	</button>
-	{/if}
-</form>
-- 
cgit v1.2.3

