mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 01:10:14 +01:00
27 lines
739 B
TypeScript
27 lines
739 B
TypeScript
|
|
import { useRecoilState } from 'recoil';
|
||
|
|
import { Switch } from '~/components/ui';
|
||
|
|
import { useLocalize } from '~/hooks';
|
||
|
|
import store from '~/store';
|
||
|
|
|
||
|
|
export default function PlusCommandSwitch() {
|
||
|
|
const [plusCommand, setPlusCommand] = useRecoilState<boolean>(store.plusCommand);
|
||
|
|
const localize = useLocalize();
|
||
|
|
|
||
|
|
const handleCheckedChange = (value: boolean) => {
|
||
|
|
setPlusCommand(value);
|
||
|
|
};
|
||
|
|
|
||
|
|
return (
|
||
|
|
<div className="flex items-center justify-between">
|
||
|
|
<div>{localize('com_nav_plus_command_description')}</div>
|
||
|
|
<Switch
|
||
|
|
id="plusCommand"
|
||
|
|
checked={plusCommand}
|
||
|
|
onCheckedChange={handleCheckedChange}
|
||
|
|
className="ml-4 mt-2"
|
||
|
|
data-testid="plusCommand"
|
||
|
|
/>
|
||
|
|
</div>
|
||
|
|
);
|
||
|
|
}
|