<script setup>
const props = defineProps({
  emojiEnabled: {
    type: Boolean,
    default: true
  },
  emoji: {
    type: String,
    default: '💡'
  },
  background: {
    type: String,
    default: 'blue'
  }
})

const backgroundClass = computed(() => {
  if (props.background === 'gray') {
    return 'prose-callout--gray'
  }

  if (props.background === 'green') {
    return 'prose-callout--green'
  }

  if (props.background === 'yellow') {
    return 'prose-callout--yellow'
  }

  if (props.background === 'red') {
    return 'prose-callout--red'
  }

  if (props.background === 'purple') {
    return 'prose-callout--purple'
  }

  if (props.background === 'pink') {
    return 'prose-callout--pink'
  }

  return 'prose-callout--blue'
})
</script>

<template>
  <aside
    class="prose-callout prose-callout-card mt-8 rounded-[10px] p-5 text-[15px] leading-8 text-[var(--site-text)]"
    :class="backgroundClass"
  >
    <div class="flex items-center gap-2">
      <span v-if="emojiEnabled" class="inline-flex shrink-0 text-[20px] leading-none">{{ emoji || '💡' }}</span>
      <div class="min-w-0 flex-1 whitespace-pre-line">
        <slot />
      </div>
    </div>
  </aside>
</template>

<style scoped>
.prose-callout--gray {
  background: rgba(100, 116, 139, 0.12);
}

.prose-callout--blue {
  background: rgba(59, 130, 246, 0.14);
}

.prose-callout--green {
  background: rgba(34, 197, 94, 0.14);
}

.prose-callout--yellow {
  background: rgba(245, 158, 11, 0.16);
}

.prose-callout--red {
  background: rgba(239, 68, 68, 0.14);
}

.prose-callout--purple {
  background: rgba(168, 85, 247, 0.14);
}

.prose-callout--pink {
  background: rgba(236, 72, 153, 0.14);
}
</style>
