mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
* refactor: Improve handling of key up events in useHandleKeyUp hook to only trigger for first char and fix linter issues * refactor: Update Beta component styling with theme twcss variables * refactor: theming for Settings, add toggle enable/disable keyboard commands
26 lines
739 B
TypeScript
26 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>
|
|
);
|
|
}
|