mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
22 lines
604 B
TypeScript
22 lines
604 B
TypeScript
import { Slider } from "@radix-ui/themes";
|
|
import type { EmbedPreviewControllerProps } from "../../pages/[...locale]/embed/[embed]/_index";
|
|
import { EmbedState, type RadixSize } from "../../stores/embedState";
|
|
|
|
export function Size({ configKey }: EmbedPreviewControllerProps) {
|
|
return (
|
|
<Slider
|
|
variant="classic"
|
|
min={0}
|
|
max={9}
|
|
value={[
|
|
EmbedState.use((state) => parseInt(state[configKey] as RadixSize)),
|
|
]}
|
|
onValueChange={([value]) => {
|
|
EmbedState.mutate((draft) => {
|
|
draft[configKey] = `${value}`;
|
|
});
|
|
}}
|
|
/>
|
|
);
|
|
}
|