import React from "react"; /** * A privacy notice's text (1.3.0): a line starting "## " is a heading, "• " (or "- ") a bullet, * anything else a paragraph. Notices published before 1.3.0 are plain paragraphs and look as before. */ export function NoticeText({ body, compact = false }: { body: string; compact?: boolean }) { const blocks: React.ReactNode[] = []; let bullets: string[] = []; const flush = () => { if (!bullets.length) return; blocks.push(); bullets = []; }; for (const raw of body.split(/\r?\n/)) { const line = raw.trim(); if (/^[•-]\s+/.test(line)) { bullets.push(line.replace(/^[•-]\s+/, "")); continue; } flush(); if (!line) continue; if (line.startsWith("## ")) blocks.push(

{line.slice(3)}

); else blocks.push(

{line}

); } flush(); return
{blocks}
; }