<script>
  import Conversation from './Conversation.svelte';

  let { conversations, active } = $props();

  function isActive(conversation) {
    return active === conversation.id;
  }
</script>

<nav class="list-nav">
  <ul>
    {#each conversations as conversation}
      <Conversation {...conversation} active={isActive(conversation)} />
    {/each}
  </ul>
</nav>
