import { ComingSoon, InfoList, SourceNote, } from "@/components/organization/OrganizationLayout"; import { RichText } from "@/components/pages/RichText"; import { Button } from "@/components/ui/Button"; import { Card } from "@/components/ui/Card"; import { Link } from "@/i18n/routing"; import type { SitePage } from "@/lib/site-pages"; import { getTranslations } from "next-intl/server"; import type { ReactNode } from "react"; function PageAnchor({ href, children, className, }: { href: string; children: ReactNode; className?: string; }) { if (href.startsWith("/")) { return ( {children} ); } return ( {children} ); } function PeopleBlock({ page }: { page: SitePage }) { const hasPhotos = page.people.some((person) => person.photo); if (hasPhotos) { return ( ); } const hasSchedule = page.people.some((person) => person.hours || person.address); if (!hasSchedule) { return ( ); } return ; } async function ReceptionPeople({ page }: { page: SitePage }) { const t = await getTranslations("organization"); return (
{page.people.map((row) => ( ))}
{t("reception.position")} {t("reception.hours")} {t("address")}

{row.position}

{row.name}

{row.hours || "—"} {row.address || "—"}
); } async function CardsBlock({ page }: { page: SitePage }) { const t = await getTranslations("organization"); return (
{page.cards.map((item) => (

{item.title}

{item.status ? (

{item.status}

) : null}
{item.role ?

{item.role}

: null}
{item.number ? (
{t("licenseNumber")}
{item.number}
) : null} {item.issuedAt ? (
{t("issuedAt")}
{item.issuedAt}
) : null} {item.authority ? (
{t("authority")}
{item.authority}
) : null} {item.activity ? (
{t("activity")}
{item.activity}
) : null} {item.phone ? (
{t("phone")}
{item.phone}
) : null} {item.address ? (
{t("address")}
{item.address}
) : null} {item.email ? (
{t("email")}
{item.email}
) : null}
{item.extract ?

{item.extract}

: null} {item.href ? ( {item.linkLabel && !item.number && !item.authority ? ( {item.linkLabel} ) : ( )} ) : null}
))}
); } async function TableBlock({ page }: { page: SitePage }) { const t = await getTranslations("legal.discounts"); return (
{page.tableCaption ? (

{page.tableCaption}

) : null}
{page.tableRows.map((row) => ( ))}
{page.tableCaption || t("heading")}
{t("category")} {t("discount")} {t("documents")}

{row.category}

{row.condition ? (

{row.condition}

) : null}
{row.discount} {row.documents}
); } export async function CmsPageBody({ page }: { page: SitePage }) { const t = await getTranslations("organization"); const ctaLabel = page.ctaLabel || page.ctaHref; return ( <>

{page.heading}

{page.subtitle ? (

{page.subtitle}

) : null}
{page.tableRows.length === 0 && page.timeline.length === 0 ? ( ) : null} {page.tableRows.length ? : null} {page.facts.length ? : null} {page.timeline.length ? (

{page.timelineTitle || t("history")}

    {page.timeline.map((item) => (
  1. {item.year} {item.text}
  2. ))}
) : null} {page.timeline.length || page.tableRows.length ? : null} {page.people.length ? : null} {page.cards.length ? : null} {page.faq.length ? (
{page.faq.map((item) => (

{item.question}

{item.answer}

))}
) : null} {page.notice ? : null} {page.ctaHref && ctaLabel ? ( page.ctaHint ? (

{page.ctaHint}{" "} {ctaLabel}

) : ( {page.ctaHref.startsWith("http") && !page.facts.length ? ( {ctaLabel} ) : ( )} ) ) : null} {page.sourceUrl ? : null}
); }