import React, { useState, useEffect } from 'react'; import Image from 'next/image'; import { CodeSample, AppSettings } from '../utils/types'; import FormatInstructions from './FormatInstructions'; interface SettingsProps { isOpen: boolean; onClose: () => void; isDarkMode: boolean; settings: AppSettings; setSettings: (settings: AppSettings) => void; saveSettings: boolean; setSaveSettings: (save: boolean) => void; } const Settings: React.FC = ({ isOpen, onClose, isDarkMode, settings, setSettings, saveSettings, setSaveSettings }) => { const [showCookieNotice, setShowCookieNotice] = useState(false); const [showFormatInstructions, setShowFormatInstructions] = useState(false); useEffect(() => { if (saveSettings && !localStorage.getItem('cookieNoticeShown')) { setShowCookieNotice(true); } }, [saveSettings]); const handleSaveSettingsChange = (e: React.ChangeEvent) => { const newValue = e.target.checked; setSaveSettings(newValue); if (newValue && !localStorage.getItem('cookieNoticeShown')) { setShowCookieNotice(true); } }; const handleCookieNoticeClose = () => { setShowCookieNotice(false); localStorage.setItem('cookieNoticeShown', 'true'); }; if (!isOpen) return null; return (

Settings

Junior Dev Mode
Party Mode
{showCookieNotice && (

We will save your settings in a cookie. Is this okay?

)} setShowFormatInstructions(false)} isDarkMode={isDarkMode} />
); }; export default Settings;