<template>
  <div class="bubble" :class="message.role">
    {{ message.content }}
  </div>
</template>

<script setup lang="ts">
import type { ChatMessage } from '../api/types';

defineProps<{ message: ChatMessage }>();
</script>

<style scoped>
.bubble {
  max-width: 78%;
  padding: 12px 14px;
  border-radius: 14px;
  line-height: 1.65;
  word-break: break-word;
}

.assistant,
.system {
  align-self: flex-start;
  border: 1px solid #e1e8f5;
  background: #ffffff;
}

.user {
  align-self: flex-end;
  background: var(--brand-primary);
  color: #ffffff;
}
</style>
