diff --git a/src/lib/block-types.ts b/src/lib/block-types.ts index 7f5802b..00807b1 100644 --- a/src/lib/block-types.ts +++ b/src/lib/block-types.ts @@ -316,6 +316,7 @@ export interface OrganisationEntry { whatsapp?: string; youtube?: string; location?: { text?: string; lat?: number; lng?: number }; + contacts?: (string | ContactEntry)[]; } /** Organisations-Block (_type: "organisations"). */ diff --git a/src/lib/components/blocks/OrganisationsMapBlock.svelte b/src/lib/components/blocks/OrganisationsMapBlock.svelte index 635e8c2..9aa0a47 100644 --- a/src/lib/components/blocks/OrganisationsMapBlock.svelte +++ b/src/lib/components/blocks/OrganisationsMapBlock.svelte @@ -2,7 +2,7 @@ import "leaflet/dist/leaflet.css"; import { onMount, onDestroy } from "svelte"; import { getBlockLayoutClasses } from "$lib/block-layout"; - import type { OrganisationsMapBlockData, OrganisationEntry } from "$lib/block-types"; + import type { OrganisationsMapBlockData, OrganisationEntry, ContactEntry } from "$lib/block-types"; import Icon from "@iconify/svelte"; import "$lib/iconify-offline"; import { marked } from "$lib/markdown-safe"; @@ -33,6 +33,12 @@ : "", ); + const contacts = $derived( + (selectedOrg?.contacts ?? []).filter( + (c): c is ContactEntry => typeof c === "object" && c !== null && !!c.name, + ), + ); + function getLink(org: OrganisationEntry): string | null { if (!org.link || typeof org.link === "string") return null; return org.link.url ?? null; @@ -156,6 +162,35 @@ {/if} + {#if contacts.length > 0} +
Ansprechpartner
+ {#each contacts as c} +{c.name}
+ {#if c.role} +{c.role}
+ {/if} + {#if c.email} + +{c.note}
+ {/if} +