import React, { useEffect, useState } from 'react'; import ReactMarkdown from 'react-markdown'; import remarkGfm from 'remark-gfm'; const Terms: React.FC = () => { const [markdown, setMarkdown] = useState(''); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); useEffect(() => { const loadMarkdown = async () => { try { setLoading(true); const res = await fetch('/duxiter_terms_md.md'); if (!res.ok) { throw new Error(`Failed to load markdown: ${res.status}`); } const text = await res.text(); setMarkdown(text); setError(null); } catch (err: any) { setError(err?.message || 'Failed to load terms content'); } finally { setLoading(false); } }; loadMarkdown(); }, []); if (loading) { return (
Loading terms...
); } if (error) { return (

Terms and Conditions

{error}

You can try opening the PDF directly: /terms.pdf

); } return (

Terms and Conditions

Below are the terms rendered from the markdown file.

{markdown}
View PDF version
); }; export default Terms;