import { Switch } from '@librechat/client'; import { RecoilState, useRecoilState } from 'recoil'; import HoverCardSettings from './HoverCardSettings'; import { useLocalize } from '~/hooks'; interface ToggleSwitchProps { stateAtom: RecoilState; localizationKey: string; hoverCardText?: string; switchId: string; onCheckedChange?: (value: boolean) => void; } const ToggleSwitch: React.FC = ({ stateAtom, localizationKey, hoverCardText, switchId, onCheckedChange, }) => { const [switchState, setSwitchState] = useRecoilState(stateAtom); const localize = useLocalize(); const handleCheckedChange = (value: boolean) => { setSwitchState(value); if (onCheckedChange) { onCheckedChange(value); } }; return (
{localize(localizationKey as any)}
{hoverCardText && }
); }; export default ToggleSwitch;