export function RichText({ html }: { html: string }) {
  return <div className="rich" dangerouslySetInnerHTML={{ __html: html }} />;
}

export function PlainText({ text }: { text?: string | null }) {
  const parts = (text ?? "").split(/\n+/).map((part) => part.trim()).filter(Boolean);
  return (
    <div className="space-y-3">
      {parts.map((part, index) => (
        <p key={`${index}-${part.slice(0, 12)}`} className="leading-8 text-muted">{part}</p>
      ))}
    </div>
  );
}

export function Unavailable() {
  return (
    <section className="shell py-24 text-center">
      <p className="text-[0.7rem] tracking-[0.16em] text-gold-deep">سیستم</p>
      <h1 className="display mt-3 text-2xl text-navy">ارتباط با سرویس محتوا برقرار نشد</h1>
      <p className="mt-3 leading-8 text-muted">رابط برنامه‌نویسی لاراول باید روی درگاه ۸۰۰۰ روشن باشد.</p>
    </section>
  );
}
