import { useState, useEffect } from 'react'; import ReactMarkdown from 'react-markdown'; import PublicLayout from '../components/layout/PublicLayout'; export default function HowItWorksPage() { const [content, setContent] = useState(''); const [loading, setLoading] = useState(true); const [error, setError] = useState(''); useEffect(() => { // Fetch markdown content fetch('/content/how-it-works.md') .then(response => { if (!response.ok) { throw new Error('Failed to load content'); } return response.text(); }) .then(text => { setContent(text); setLoading(false); }) .catch(err => { console.error('Error loading how-it-works content:', err); setError('Failed to load page content'); setLoading(false); }); }, []); if (loading) { return (

Loading...

); } if (error) { return (

{error}

); } return (
{ const isInternal = href && href.startsWith('/'); if (isInternal) { return ( {children} ); } return ( {children} ); }, // Ensure images are responsive img: ({ node, ...props }) => ( {props.alt ), }} > {content}
); }