import { Slider as SliderPrimitive } from "radix-ui"; import * as React from "react"; import { cn } from "~/lib/utils"; interface SliderProps extends React.ComponentPropsWithoutRef { rangeClassName?: string; thumbClassName?: string; } function Slider({ className, thumbClassName, rangeClassName, defaultValue, value, min = 0, max = 100, ...props }: React.ComponentProps & SliderProps) { const _values = React.useMemo(() => { if (Array.isArray(value)) return value; if (Array.isArray(defaultValue)) return defaultValue; return [min, max]; }, [value, defaultValue, min, max]); return ( {Array.from({ length: _values.length }, (_, index) => ( key={index} /> ))} ); } export { Slider };