<script lang="ts">
  import Button from "@lib/components/Button.svelte"
  import ModalHeader from "@lib/components/ModalHeader.svelte"
  import ModalTitle from "@lib/components/ModalTitle.svelte"
  import ModalFooter from "@lib/components/ModalFooter.svelte"
  import Modal from "@lib/components/Modal.svelte"
  import ModalBody from "@lib/components/ModalBody.svelte"
  import Profile from "@app/components/Profile.svelte"

  interface Props {
    pubkeys: string[]
  }

  const {pubkeys}: Props = $props()
</script>

<Modal>
  <ModalBody>
    <ModalHeader>
      <ModalTitle>People in this conversation</ModalTitle>
    </ModalHeader>
    <div class="flex flex-col gap-2">
      {#each pubkeys as pubkey (pubkey)}
        <div class="card2 bg-alt">
          <Profile {pubkey} />
        </div>
      {/each}
    </div>
  </ModalBody>
  <ModalFooter>
    <Button class="btn btn-primary" onclick={() => history.back()}>Got it</Button>
  </ModalFooter>
</Modal>
