<script lang="ts" setup>
const props = defineProps({
  message: {
    type: String,
    default: null,
  },
  name: {
    type: String,
    default: "AI 智慧校园",
  },
  icon: {
    type: String,
    default: "tabler:robot-face",
  },
});
</script>

<template>
  <div class="flex flex-col gap-2">
    <div class="flex gap-1.5 items-center">
      <div
        class="w-7 h-7 rounded-lg border border-neutral-200 bg-white shadow-sm flex justify-center items-center dark:bg-neutral-700 dark:border-neutral-600"
      >
        <UIcon :name="icon" />
      </div>
      <span class="text-sm font-medium">{{ name }}</span>
    </div>
    <div class="rounded-lg bg-white/50 p-2 text-sm dark:bg-neutral-800/50">
      <span v-if="message">
        <Markdown :source="message" />
        <!-- {{ message }} -->
      </span>
      <span v-else class="flex items-center gap-1.5">
        <UIcon name="svg-spinners:3-dots-scale" class="text-lg -mt-0.5" />
        <p class="text-xs">思考中</p>
      </span>
    </div>
  </div>
</template>

<style scoped></style>
