import { Center, Loader, Modal, Paper, Text } from "@mantine/core"; import { useContractTemplatePreview } from "@/hooks/contract-templates/useContractTemplates"; interface TemplatePreviewModalProps { code: string | null; title?: string; onClose: () => void; } /** Full-document HTML preview rendered by the API against mock contract data. */ export default function TemplatePreviewModal({ code, title, onClose, }: TemplatePreviewModalProps) { const { data, isLoading, isError } = useContractTemplatePreview( code ?? undefined, Boolean(code), ); return ( {isLoading ? (
) : isError ? (
Failed to render the preview.
) : (