import React from 'react';
import MarketingLayout from '@/layouts/mainWebsite';

type LegalShowProps = {
  seoTitle: string;
  title: string;
  content: string;
  effectiveFrom?: string | null;
  effectiveFromLabel?: string | null;
  versionLabel?: string | null;
  slug: string;
};

export default function LegalShow(props: LegalShowProps) {
  const { seoTitle, title, content, effectiveFromLabel, versionLabel } = props;

  return (
    <MarketingLayout title={seoTitle}>

      <section className="bg-white py-16">
        <div className="mx-auto max-w-4xl px-6">
          <header className="mb-10">
            <p className="text-sm uppercase tracking-[0.2em] text-gray-400">
              FotoSpiel.App
            </p>
            <h1 className="mt-2 text-3xl font-semibold text-gray-900 md:text-4xl">
              {title}
            </h1>
            {(effectiveFromLabel || versionLabel) && (
              <p className="mt-3 text-sm text-gray-500">
                {[effectiveFromLabel, versionLabel].filter(Boolean).join(' · ')}
              </p>
            )}
          </header>

          <article
            className="prose prose-slate max-w-none prose-headings:font-display"
            dangerouslySetInnerHTML={{ __html: content }}
          />
        </div>
      </section>
    </MarketingLayout>
  );
}
