<script lang="ts">
    import {Avatar, Button, Modal} from "flowbite-svelte";
    import type {ExtendedEvent} from "../../types/event.js";

    export let data: ExtendedEvent;
</script>
<div class="m-4">
    {#each data.teams as team}
        <div class="flex flex-row my-2">
            <Avatar size="lg">{team.kuerzel}</Avatar>
            <div class="m-2">
                <h1 class="text-2xl">{team.name}</h1>
                <h2 class="text-lg text-gray-400">Fights: {data.fights.filter(value => value.blueTeam.id === team.id || value.redTeam.id === team.id).length}</h2>
            </div>
        </div>
    {/each}
</div>

<svelte:head>
    <title>{data.event.name} - Teams</title>
</svelte:head>
