import type { CmsSlot } from '@/components/cms/types';

export default function CmsElementText({ slot }: { slot: CmsSlot }) {
  const html =
    slot.data?.content ??
    slot.config?.content?.value ??
    (typeof slot.data === 'string' ? slot.data : '') ??
    '';
  if (!html) return null;
  return (
    <div
      className="prose prose-base max-w-none text-surface-800 prose-headings:text-surface-900 prose-a:text-brand-600 hover:prose-a:text-brand-700 prose-strong:text-surface-900"
      dangerouslySetInnerHTML={{ __html: html }}
    />
  );
}
