2026-08-05 14:17:33 -05:00
|
|
|
import type { EmbedPreviewControllerProps } from "../../pages/[...chunk_default]/[...locale]/embed/[embed]/_index";
|
2026-11-19 16:59:43 -06:00
|
|
|
import { EmbedState } from "../../stores/embedState";
|
|
|
|
|
import type { SpaceWithout0 } from "../../types/styles";
|
|
|
|
|
import { RangeSlider } from "./RangeSlider";
|
2024-10-26 14:33:04 -05:00
|
|
|
|
|
|
|
|
export function SizeWithout0({ configKey }: EmbedPreviewControllerProps) {
|
|
|
|
|
return (
|
2026-11-19 16:59:43 -06:00
|
|
|
<RangeSlider
|
2024-10-26 14:33:04 -05:00
|
|
|
min={1}
|
|
|
|
|
max={9}
|
2026-11-19 16:59:43 -06:00
|
|
|
value={EmbedState.use((state) =>
|
|
|
|
|
parseInt(state[configKey] as SpaceWithout0),
|
|
|
|
|
)}
|
|
|
|
|
onValueChange={(value) => {
|
2025-09-02 16:24:13 -05:00
|
|
|
EmbedState.mutate((draft) => {
|
2024-10-26 14:33:04 -05:00
|
|
|
draft[configKey] = `${value}`;
|
|
|
|
|
});
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|