'use client';
import { useState } from 'react';
import {
Dialog,
DialogTitle,
DialogContent,
DialogActions,
Button,
Typography,
Box,
Checkbox,
FormControlLabel,
Link,
Alert,
Divider,
} from '@mui/material';
import { Gavel, Warning } from '@mui/icons-material';
import { LegalDocumentViewer } from './LegalDocumentViewer';
interface EULADialogProps {
open: boolean;
onAccept: () => void;
onDecline: () => void;
}
export function EULADialog({ open, onAccept, onDecline }: EULADialogProps) {
const [agreedToTerms, setAgreedToTerms] = useState(false);
const [agreedToPrivacy, setAgreedToPrivacy] = useState(false);
const [agreedToEULA, setAgreedToEULA] = useState(false);
const [viewingDocument, setViewingDocument] = useState<{
type: 'terms' | 'privacy' | 'eula' | null;
title: string;
}>({ type: null, title: '' });
const canAccept = agreedToTerms && agreedToPrivacy && agreedToEULA;
const handleAccept = () => {
if (canAccept) {
onAccept();
}
};
const openDocument = (type: 'terms' | 'privacy' | 'eula', title: string) => (e: React.MouseEvent) => {
e.preventDefault();
setViewingDocument({ type, title });
};
const closeDocumentViewer = () => {
setViewingDocument({ type: null, title: '' });
};
return (
<>
{/* Legal Document Viewer - appears on top of EULA dialog */}
{viewingDocument.type && (
)}
>
);
}