mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 19:19:52 +02:00
20 lines
592 B
TypeScript
20 lines
592 B
TypeScript
import { Switch } from '@radix-ui/themes';
|
|
import type { EmbedPreviewControllerProps } from '../../pages/[...locale]/tools/embed/[embed]/_index';
|
|
import { EmbedState } from '../../stores/embedState';
|
|
|
|
export function Boolean({ configKey }: EmbedPreviewControllerProps) {
|
|
const mutateEmbedState = EmbedState.useMutation();
|
|
|
|
return (
|
|
<Switch
|
|
variant="soft"
|
|
checked={EmbedState.use((state) => state[configKey] as boolean)}
|
|
onCheckedChange={() => {
|
|
mutateEmbedState((draft) => {
|
|
draft[configKey] = !draft[configKey];
|
|
});
|
|
}}
|
|
/>
|
|
);
|
|
}
|