feat: add internal_component block type with contact form
InternalComponentBlock dispatches on `component` field value. ContactFormComponent submits via /api/contact (SvelteKit proxy → CMS /api/forms/kontakt/submit) with honeypot + client_age_ms. BlockRenderer and block-types.ts updated accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user