import { articleProse } from "@/components/content/article-ui";

/**
 * Renders a static CMS page (About, Privacy, Terms, …). The body is admin-authored
 * HTML when a matching `kind = Page` row exists; otherwise the caller passes
 * built-in `fallbackHtml` so the page is never blank.
 */
export function CmsPageContent({
  title,
  html,
  lead,
}: {
  title: string;
  html: string;
  lead?: string;
}) {
  return (
    <div className="mx-auto max-w-3xl px-4 py-14 sm:px-6 lg:px-8">
      <h1 className="font-heading text-3xl font-extrabold tracking-tight text-neutral-900 sm:text-4xl">
        {title}
      </h1>
      {lead && <p className="mt-4 text-lg leading-relaxed text-neutral-500">{lead}</p>}
      <div className={`mt-8 ${articleProse}`} dir="auto" dangerouslySetInnerHTML={{ __html: html }} />
    </div>
  );
}
