<script lang="ts">
  import { getBlockLayoutClasses } from "$lib/block-layout";
  import type { QuoteBlockData } from "$lib/block-types";

  let { block }: { block: QuoteBlockData } = $props();

  const layoutClasses = $derived(getBlockLayoutClasses(block.layout));
  const variantClass = $derived(block.variant === "right" ? "text-right" : "text-left");
</script>

<div class={layoutClasses} data-block-type="quote" data-block-slug={block._slug}>
  <blockquote class="border-l-4 border-green-700 pl-4 {variantClass}">
    <p class="text-lg italic text-zinc-700">"{block.quote ?? ""}"</p>
    {#if block.author}
      <cite class="mt-1 block not-italic text-sm text-zinc-500">— {block.author}</cite>
    {/if}
  </blockquote>
</div>
