"use client" import * as React from "react" import { Slider as SliderPrimitive } from "radix-ui" import { cn } from "../lib/utils" function Slider({ className, defaultValue, value, min = 0, max = 100, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: React.ComponentProps) { const _values = React.useMemo( () => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max], [value, defaultValue, min, max] ) // Build optional props to satisfy exactOptionalPropertyTypes const optionalProps: Record = {} if (defaultValue !== undefined) optionalProps.defaultValue = defaultValue if (value !== undefined) optionalProps.value = value if (min !== undefined) optionalProps.min = min if (max !== undefined) optionalProps.max = max return ( {Array.from({ length: _values.length }, (_, index) => ( ))} ) } export { Slider }