<script setup>
const props = defineProps({
  variant: {
    type: String,
    default: 'default'
  },
  background: {
    type: String,
    default: 'gray'
  }
})

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

  if (props.background === 'blue') {
    return 'prose-blockquote--blue'
  }

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

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

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

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

  return 'prose-blockquote--gray'
})
</script>

<template>
  <blockquote
    class="prose-blockquote mb-5 text-[15px] leading-8"
    :class="variant === 'alt'
      ? 'rounded-[14px] border border-[var(--site-line)] bg-[var(--site-panel)] px-6 py-5 italic text-[var(--site-text)]'
      : ['border-l-[3px] bg-transparent py-1 pl-5 pr-0 font-normal text-[#15171a]', backgroundClass]"
  >
    <span class="block whitespace-pre-line">
      <slot />
    </span>
  </blockquote>
</template>

<style scoped>
.prose-blockquote--gray {
  border-color: #050505;
}

.prose-blockquote--blue {
  border-color: #0055ff;
}

.prose-blockquote--green {
  border-color: #16ae68;
}

.prose-blockquote--yellow {
  border-color: #ffff00;
}

.prose-blockquote--red {
  border-color: #ff0000;
}

.prose-blockquote--purple {
  border-color: #8800ff;
}
</style>
