<script lang="ts">

    import type {UsersRoom} from "../../types/auth.type";

    export let rooms: UsersRoom[]

</script>

<div>
    <ul>
        {#each rooms as room}
            <li>
                <a href="/room/{room.id_code}">{room.name} ({room.admin ? "Administrateur" : "Member"})</a>
            </li>
        {/each}
    </ul>
</div>

<style lang="scss">
  ul {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 10px;
    padding: 10px;
    align-items: center;
  }

  a {
    text-decoration: none;
    display: flex;
    gap: 10px;
    align-items: center;
    color: #f8f8f8;
    transition: 0.2s;
    &:hover {
      color: $primary;
    }
  }
</style>