import React, { useEffect } from 'react'; import { createPortal } from 'react-dom'; import { X, Code, ClipboardText } from '@phosphor-icons/react'; import { motion, AnimatePresence } from 'framer-motion'; import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; import { coy } from 'react-syntax-highlighter/dist/esm/styles/prism'; import LuxeArt from './LuxeArt'; import { useToast } from '../hooks/useToast'; const LuxeCodeModal = ({ isOpen, onClose, children, language }) => { const { addToast } = useToast(); useEffect(() => { if (isOpen) { document.body.style.overflow = 'hidden'; } else { document.body.style.overflow = ''; } return () => { document.body.style.overflow = ''; }; }, [isOpen]); const handleCopy = () => { navigator.clipboard.writeText(children).then(() => { addToast({ title: 'Archive Synchronized', message: 'Code snippet copied to local clipboard.', type: 'success', }); }); }; return createPortal( {isOpen && ( e.stopPropagation()} initial={{ scale: 0.98, opacity: 0, y: 20 }} animate={{ scale: 1, opacity: 1, y: 0 }} exit={{ scale: 0.98, opacity: 0, y: 20 }} transition={{ type: 'spring', damping: 35, stiffness: 200 }} >
{/* Header */}
Technical Specification

{language?.toUpperCase() || 'SOURCE'}

{/* Content */}
{children}
{/* Footer */}
Refined Syntax Presentation
Archive Online
)}
, document.body, ); }; export default LuxeCodeModal;