iconPanel.tsx 967 B

1234567891011121314151617181920212223242526272829303132
  1. import {forwardRef} from 'react';
  2. import {useTheme} from '@emotion/react';
  3. import {SvgIcon, SVGIconProps} from './svgIcon';
  4. interface Props extends SVGIconProps {
  5. direction?: 'up' | 'right' | 'down' | 'left';
  6. }
  7. const IconPanel = forwardRef<SVGSVGElement, Props>(
  8. ({direction = 'up', ...props}, ref) => {
  9. const theme = useTheme();
  10. return (
  11. <SvgIcon
  12. {...props}
  13. ref={ref}
  14. style={{
  15. transform: direction
  16. ? `rotate(${theme.iconDirections[direction]}deg)`
  17. : undefined,
  18. }}
  19. >
  20. <path d="M16,13.25V2.75C16,1.23,14.77,0,13.25,0H2.75C1.23,0,0,1.23,0,2.75V13.25c0,1.52,1.23,2.75,2.75,2.75H13.25c1.52,0,2.75-1.23,2.75-2.75ZM1.5,4.58v-1.83c0-.69,.56-1.25,1.25-1.25H13.25c.69,0,1.25,.56,1.25,1.25v1.83H1.5Zm1.25,9.92c-.69,0-1.25-.56-1.25-1.25V6.08H14.5v7.17c0,.69-.56,1.25-1.25,1.25H2.75Z" />
  21. </SvgIcon>
  22. );
  23. }
  24. );
  25. IconPanel.displayName = 'IconPanel';
  26. export {IconPanel};