import React, { useEffect } from 'react'; interface PrivacySettingsProps { selectedOption: string; // The currently selected option handleRadioChange: (option: string) => void; // Function to handle option changes openSourceMode: boolean; // Boolean to check if the mode is open source } const PrivacySettings: React.FC = ({ selectedOption, handleRadioChange, openSourceMode }) => { // Set default option based on openSourceMode if no option is selected useEffect(() => { if (!selectedOption) { handleRadioChange(openSourceMode ? 'Offline' : 'None'); } }, [selectedOption, handleRadioChange, openSourceMode]); // Handle option click, allowing all options even in open-source mode const handleOptionClick = (option: string) => { handleRadioChange(option); // No restrictions on options }; return ( <> {/* AI Mode Radio Options */}

{openSourceMode ? 'Disable Options (FOSS Mode):' : 'Disable Options:'}

{/* Offline */}
handleOptionClick('Offline')} style={{ pointerEvents: (openSourceMode && selectedOption !== 'Offline') ? 'none' : 'auto', opacity: (openSourceMode && selectedOption !== 'Offline') ? 0.5 : 1 }} > Offline tools{openSourceMode ? ' (FOSS)' : ''}
{/* Online (Available even in FOSS mode) */}
handleOptionClick('Online')} > Online tools{openSourceMode ? ' (FOSS)' : ''}
{/* None */}
handleOptionClick('None')} style={{ pointerEvents: (openSourceMode && selectedOption !== 'None') ? 'none' : 'auto', opacity: (openSourceMode && selectedOption !== 'None') ? 0.5 : 1 }} > None{openSourceMode ? ' (FOSS)' : ''}

); }; export default PrivacySettings;