iconGraph.tsx 951 B

12345678910111213141516171819202122232425262728293031
  1. import {forwardRef} from 'react';
  2. import {IconGraphArea} from './iconGraphArea';
  3. import {IconGraphBar} from './iconGraphBar';
  4. import {IconGraphCircle} from './iconGraphCircle';
  5. import {IconGraphLine} from './iconGraphLine';
  6. import {IconGraphScatter} from './iconGraphScatter';
  7. import type {SVGIconProps} from './svgIcon';
  8. interface Props extends SVGIconProps {
  9. type?: 'line' | 'circle' | 'bar' | 'area' | 'scatter';
  10. }
  11. const IconGraph = forwardRef<SVGSVGElement, Props>(({type = 'line', ...props}, ref) => {
  12. switch (type) {
  13. case 'circle':
  14. return <IconGraphCircle {...props} ref={ref} />;
  15. case 'bar':
  16. return <IconGraphBar {...props} ref={ref} />;
  17. case 'area':
  18. return <IconGraphArea {...props} ref={ref} />;
  19. case 'scatter':
  20. return <IconGraphScatter {...props} ref={ref} />;
  21. default:
  22. return <IconGraphLine {...props} ref={ref} />;
  23. }
  24. });
  25. IconGraph.displayName = 'IconGraph';
  26. export {IconGraph};