Files
blitzkit/packages/website/src/components/Embeds/SizeWithout0.tsx
T

23 lines
647 B
TypeScript
Raw Normal View History

2025-09-02 16:24:13 -05:00
import { Slider } from "@radix-ui/themes";
import type { EmbedPreviewControllerProps } from "../../pages/[...locale]/embed/[embed]/_index";
import { EmbedState, type RadixSizeWithout0 } from "../../stores/embedState";
2024-10-26 14:33:04 -05:00
export function SizeWithout0({ configKey }: EmbedPreviewControllerProps) {
return (
<Slider
2025-04-21 17:01:32 -05:00
variant="classic"
2024-10-26 14:33:04 -05:00
min={1}
max={9}
value={[
EmbedState.use((state) =>
2025-09-02 16:24:13 -05:00
parseInt(state[configKey] as RadixSizeWithout0)
2024-10-26 14:33:04 -05:00
),
]}
onValueChange={([value]) => {
2025-09-02 16:24:13 -05:00
EmbedState.mutate((draft) => {
2024-10-26 14:33:04 -05:00
draft[configKey] = `${value}`;
});
}}
/>
);
}