2024-10-03 17:36:09 +02:00
|
|
|
// PrivacySettings.tsx
|
|
|
|
import React from 'react';
|
2024-10-01 12:45:21 +02:00
|
|
|
|
|
|
|
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<PrivacySettingsProps> = ({ selectedOption, handleRadioChange, openSourceMode }) => {
|
2024-10-03 17:36:09 +02:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{/* AI Mode Radio Options */}
|
|
|
|
<div className="settings-option">
|
|
|
|
<p>Disable Options:</p>
|
|
|
|
<div className="slider">
|
|
|
|
{/* Offline */}
|
|
|
|
<div
|
|
|
|
className={`slider-option ${selectedOption === 'Offline' ? 'active' : ''}`}
|
|
|
|
onClick={() => handleRadioChange('Offline')} // Allow selection only if not in open-source mode
|
|
|
|
>
|
|
|
|
Offline tools{openSourceMode ? ' (FOSS)' : ''}
|
|
|
|
</div>
|
2024-10-03 14:38:56 +02:00
|
|
|
|
2024-10-03 17:36:09 +02:00
|
|
|
{/* Online */}
|
|
|
|
<div
|
|
|
|
className={`slider-option ${selectedOption === 'Online' ? 'active' : ''}`}
|
|
|
|
onClick={() => handleRadioChange('Online')}
|
|
|
|
>
|
|
|
|
Online tools{openSourceMode ? ' (FOSS)' : ''}
|
|
|
|
</div>
|
2024-10-03 14:38:56 +02:00
|
|
|
|
2024-10-03 17:36:09 +02:00
|
|
|
{/* None */}
|
|
|
|
<div
|
|
|
|
className={`slider-option ${selectedOption === 'None' ? 'active' : ''}`}
|
|
|
|
onClick={() => handleRadioChange('None')}
|
|
|
|
>
|
|
|
|
None{openSourceMode ? ' (FOSS)' : ''}
|
|
|
|
</div>
|
2024-10-01 15:34:43 +02:00
|
|
|
</div>
|
2024-10-03 17:36:09 +02:00
|
|
|
<br />
|
|
|
|
</div>
|
|
|
|
</>
|
2024-10-01 12:45:21 +02:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default PrivacySettings;
|