<script lang="ts">
	import QR from '@svelte-put/qr/svg/QR.svelte';
	import CopyButton from '$lib/components/CopyButton.svelte';
	import Icon from '@iconify/svelte';

	const invite = window.eve.generateInviteCode();
</script>

{#await invite then invite}
	<div class="flex justify-center">
		<QR
			class="w-92 align-center"
			data={invite}
			moduleFill="#00badd"
			logo={'/favicon.png'}
			shape="circle"
			anchorOuterFill="#00ddba"
			anchorInnerFill="#00badd"
		/>
	</div>
	<div class="join w-92">
		<pre class="input w-full overflow-x-scroll">{invite}</pre>
		<CopyButton data={invite} />
	</div>
{/await}
