<script lang="ts">
  import { getBlockLayoutClasses } from "$lib/block-layout";
  import type { InternalComponentBlockData } from "$lib/block-types";
  import ContactFormComponent from "$lib/components/internal/ContactFormComponent.svelte";

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

  const layoutClasses = $derived(getBlockLayoutClasses(block.layout));
  const component = $derived(block.component ?? "");
</script>

<div class={layoutClasses} data-block="InternalComponent" data-block-type="internal_component" data-block-slug={block._slug}>
  {#if component === "form-contact"}
    <ContactFormComponent />
  {:else}
    <p class="text-sm text-stein-500">Unbekannte interne Komponente: <code>{component}</code></p>
  {/if}
</div>
