iconGraph.tsx 719 B

12345678910111213141516171819202122232425262728
  1. import React from 'react';
  2. import {IconGraphBar} from './iconGraphBar';
  3. import {IconGraphCircle} from './iconGraphCircle';
  4. import {IconGraphLine} from './iconGraphLine';
  5. import SvgIcon from './svgIcon';
  6. type Props = React.ComponentProps<typeof SvgIcon> & {
  7. type?: 'line' | 'circle' | 'bar';
  8. };
  9. const IconGraph = React.forwardRef(function IconGraph(
  10. {type = 'line', ...props}: Props,
  11. ref: React.Ref<SVGSVGElement>
  12. ) {
  13. switch (type) {
  14. case 'circle':
  15. return <IconGraphCircle {...props} ref={ref} />;
  16. case 'bar':
  17. return <IconGraphBar {...props} ref={ref} />;
  18. default:
  19. return <IconGraphLine {...props} ref={ref} />;
  20. }
  21. });
  22. IconGraph.displayName = 'IconGraph';
  23. export {IconGraph};