iconGraph.tsx 835 B

123456789101112131415161718192021222324252627282930
  1. import * as React from 'react';
  2. import {IconGraphArea} from './iconGraphArea';
  3. import {IconGraphBar} from './iconGraphBar';
  4. import {IconGraphCircle} from './iconGraphCircle';
  5. import {IconGraphLine} from './iconGraphLine';
  6. import {SVGIconProps} from './svgIcon';
  7. interface Props extends SVGIconProps {
  8. type?: 'line' | 'circle' | 'bar' | 'area';
  9. }
  10. const IconGraph = React.forwardRef<SVGSVGElement, Props>(
  11. ({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. default:
  20. return <IconGraphLine {...props} ref={ref} />;
  21. }
  22. }
  23. );
  24. IconGraph.displayName = 'IconGraph';
  25. export {IconGraph};