import React from "react"; import { ScrollView, Text, useWindowDimensions, View } from "react-native"; import { Dialog } from "./dialog"; import { EntropyByline } from "./entropy-mark"; export interface LegalDialogProps { visible: boolean; onClose: () => void; /** e.g. "Terms of Service" / "Privacy Policy". */ title: string; /** Body copy. Split into paragraphs on blank lines. App-supplied so each * app customises the wording; the dialog itself is themed by the palette. */ content?: string; } /** * Reusable legal popup (Terms / Privacy / etc). A scrollable dialog instead * of a dedicated route — apps pass their own `content` and inherit the * active theme. Built on the shared `Dialog`. */ export function LegalDialog({ visible, onClose, title, content }: LegalDialogProps) { const { height } = useWindowDimensions(); const paragraphs = (content ?? `${title} for this application.`) .trim() .split(/\n{2,}/) .map((p) => p.trim()) .filter(Boolean); return ( {paragraphs.map((p, i) => ( {p} ))} ); } export default LegalDialog;