index.tsx 871 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import React from 'react';
  2. import Typography from '../Typography';
  3. import Sliders from '../Sliders';
  4. import { Group, SliderWrapper } from '../../global/toolStyled';
  5. type Props = {
  6. title: string;
  7. defaultValue?: number;
  8. value?: number;
  9. tips: string;
  10. onSlide: (value: number) => void;
  11. minimum?: number;
  12. maximum?: number;
  13. };
  14. const index = ({
  15. title,
  16. defaultValue,
  17. value,
  18. tips,
  19. onSlide,
  20. minimum,
  21. maximum,
  22. }: Props): React.ReactElement => (
  23. <>
  24. <Typography variant="subtitle" style={{ marginTop: '4px' }} align="left">
  25. {title}
  26. </Typography>
  27. <Group>
  28. <SliderWrapper>
  29. <Sliders
  30. minimum={minimum}
  31. maximum={maximum}
  32. defaultValue={defaultValue}
  33. value={value}
  34. onChange={onSlide}
  35. />
  36. </SliderWrapper>
  37. {tips}
  38. </Group>
  39. </>
  40. );
  41. export default index;