import React, { useState, useEffect } from 'react'; import { Dialog, DialogContent } from './dialog'; import { Button } from './Button'; import { FiShield, FiCheck, FiX, FiLock, FiChevronDown } from 'react-icons/fi'; import Typography from './Typography'; import { useLegalStore } from '../../stores/legalStore'; import { processMarkdown } from '../../utils/markdownProcessor'; import { motion, AnimatePresence } from 'framer-motion'; import { PRIVACY_POLICY } from '../../constants/legal'; interface PrivacyModalProps { open: boolean; onOpenChange: (open: boolean) => void; onAccept: () => void; onDecline: () => void; } /** * Privacy Policy modal component for displaying and accepting privacy policy */ export const PrivacyModal: React.FC = ({ open, onOpenChange, onAccept, onDecline, }) => { const [hasScrolledToBottom, setHasScrolledToBottom] = useState(false); const { legalAcceptance } = useLegalStore(); const privacyContent = PRIVACY_POLICY; const isLoading = false; const handleScroll = (e: React.UIEvent) => { const element = e.currentTarget; const hasScrolledToEnd = element.scrollHeight - element.scrollTop <= element.clientHeight + 10; setHasScrolledToBottom(hasScrolledToEnd); }; const handleAccept = () => { onAccept(); onOpenChange(false); }; const handleDecline = () => { onDecline(); onOpenChange(false); }; return ( {/* Clean header */}
Privacy Policy Learn how we protect and handle your personal information
{isLoading ? (
Loading Privacy Policy...
) : ( <>
{!hasScrolledToBottom && ( Scroll to read the complete policy )} )}
{legalAcceptance.privacyAccepted && ( Previously accepted )}
); };