<script>
  import Invite from '$lib/components/Invite.svelte';

  let { invites, createInvite = async () => {} } = $props();

  async function onsubmit(event) {
    event.preventDefault();
    await createInvite();
  }
</script>

<form class="form" {onsubmit}>
  <button type="submit">create invitation</button>
</form>

<ul class="invite-list">
  {#each invites as invite}
    <li><Invite id={invite.id} /></li>
  {/each}
</ul>
