Download client/src/components/Prompts/Groups/AutoSendPrompt.tsx from Zhitomir/chat: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/spaces/Zhitomir/chat/resolve/main/client/src/components/Prompts/Groups/AutoSendPrompt.tsx
- Command line
-
hf download hf://spaces/Zhitomir/chat/client/src/components/Prompts/Groups/AutoSendPrompt.tsx
-
curl -L -o AutoSendPrompt.tsx https://huggingface.co/spaces/Zhitomir/chat/resolve/main/client/src/components/Prompts/Groups/AutoSendPrompt.tsx
1.02 kB
| import { useRecoilState } from 'recoil'; | |
| import { Switch } from '~/components/ui'; | |
| import { useLocalize } from '~/hooks'; | |
| import { cn } from '~/utils'; | |
| import store from '~/store'; | |
| export default function AutoSendPrompt({ | |
| onCheckedChange, | |
| className = '', | |
| }: { | |
| onCheckedChange?: (value: boolean) => void; | |
| className?: string; | |
| }) { | |
| const [autoSendPrompts, setAutoSendPrompts] = useRecoilState<boolean>(store.autoSendPrompts); | |
| const localize = useLocalize(); | |
| const handleCheckedChange = (value: boolean) => { | |
| setAutoSendPrompts(value); | |
| if (onCheckedChange) { | |
| onCheckedChange(value); | |
| } | |
| }; | |
| return ( | |
| <div | |
| className={cn( | |
| 'flex select-none items-center justify-end gap-2 text-right text-sm', | |
| className, | |
| )} | |
| > | |
| <div> {localize('com_nav_auto_send_prompts')} </div> | |
| <Switch | |
| id="autoSendPrompts" | |
| checked={autoSendPrompts} | |
| onCheckedChange={handleCheckedChange} | |
| data-testid="autoSendPrompts" | |
| /> | |
| </div> | |
| ); | |
| } | |