'use client'; import React, { useState } from 'react'; import { useProofing } from './ProofingContext'; import { IconCheck, IconCopy, IconLink } from './Icons'; export function ProofingModal() { const proofing = useProofing(); const [copiedState, setCopiedState] = useState<'none' | 'link' | 'list'>('none'); if (!proofing || !proofing.isModalOpen) return null; const { favorites, isModalOpen, setIsModalOpen, getProofingUrl, getFormattedList, clearFavorites, allowMailto, } = proofing; const handleCopyLink = () => { const url = getProofingUrl(); navigator.clipboard.writeText(url).then(() => { setCopiedState('link'); setTimeout(() => setCopiedState('none'), 2000); }); }; const handleCopyList = () => { const list = getFormattedList(); navigator.clipboard.writeText(list).then(() => { setCopiedState('list'); setTimeout(() => setCopiedState('none'), 2000); }); }; const handleMailto = () => { const subject = encodeURIComponent(`Photo Selection (${favorites.size} items)`); const body = encodeURIComponent( `Hello,\n\nHere is my photo selection:\n\n${getFormattedList()}\n\nShare Link: ${getProofingUrl()}\n\nBest regards,`, ); window.location.href = `mailto:?subject=${subject}&body=${body}`; }; return (
setIsModalOpen(false)} style={{ position: 'fixed', inset: 0, backgroundColor: 'rgba(0,0,0,0.7)', backdropFilter: 'blur(4px)', zIndex: 9999, display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '1rem', }} >
e.stopPropagation()} style={{ background: 'var(--bg-surface, #1e1e1e)', color: 'var(--text-primary, #ffffff)', borderRadius: 'var(--radius-md, 12px)', border: '1px solid var(--border-color, rgba(255,255,255,0.1))', padding: '1.5rem', maxWidth: '480px', width: '100%', boxShadow: '0 20px 40px rgba(0,0,0,0.5)', }} >

❤️ Selection ({favorites.size})

You have selected {favorites.size} photo{favorites.size === 1 ? '' : 's'}. Choose an export option below to share your selection:

{allowMailto && ( )}
); }