<script lang="ts">
    import type { Chat } from "./chat"
    let {
        chat,
    }: {
        chat: Chat
    } = $props()
</script>

<div>
    {#each chat.messages as message, idx (idx)}
        <div
            class="message"
            class:assistant={message.role === "assistant"}
            class:user={message.role === "user"}
        >
            {@html message.content}
        </div>
    {/each}
</div>

<style lang="less">
</style>
