mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-16 06:06:11 +01:00
23 lines
648 B
TypeScript
23 lines
648 B
TypeScript
import { Slider } from '@radix-ui/themes';
|
|||
|
|
import type { EmbedPreviewControllerProps } from '../../pages/tools/embed/[embed]/_index';
|
||
|
|
import { EmbedState, type RadixSize } from '../../stores/embedState';
|
||
|
|
|
||
|
|
export function Size({ configKey }: EmbedPreviewControllerProps) {
|
||
|
|
const mutateEmbedState = EmbedState.useMutation();
|
||
|
|
|
||
|
|
return (
|
||
|
|
<Slider
|
||
|
|
variant="soft"
|
||
|
|
min={0}
|
||
|
|
max={9}
|
||
|
|
value={[
|
||
|
|
EmbedState.use((state) => parseInt(state[configKey] as RadixSize)),
|
||
|
|
]}
|
||
|
|
onValueChange={([value]) => {
|
||
|
|
mutateEmbedState((draft) => {
|
||
|
|
draft[configKey] = `${value}`;
|
||
|
|
});
|
||
|
|
}}
|
||
|
|
/>
|
||
|
|
);
|
||
|
|
}
|