import React, { useState, useEffect } from "react"; import PropTypes from "prop-types"; import { ColorTheme, ThemeType } from "@docspace/common/components/ColorTheme"; const Slider = (props) => { const { id, type, className, onChange, min, max, step, value, withPouring, style, isReadOnly = false, isDisabled = false, thumbBorderWidth, thumbHeight, thumbWidth, runnableTrackHeight, } = props; const [size, setSize] = useState("0%"); useEffect(() => { setSize(((value - min) * 100) / (max - min) + "%"); }, [value]); return ( ); }; Slider.propTypes = { id: PropTypes.string, type: PropTypes.string, className: PropTypes.string, thumbWidth: PropTypes.string, thumbHeight: PropTypes.string, thumbBorderWidth: PropTypes.string, runnableTrackHeight: PropTypes.string, onChange: PropTypes.func, min: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), max: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), step: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), value: PropTypes.number, withPouring: PropTypes.bool, isReadOnly: PropTypes.bool, isDisabled: PropTypes.bool, style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), }; export default Slider;