iconPanel.tsx 998 B

123456789101112131415161718192021222324252627282930313233
  1. import {forwardRef} from 'react';
  2. import {useTheme} from '@emotion/react';
  3. import type {SVGIconProps} from './svgIcon';
  4. import {SvgIcon} from './svgIcon';
  5. interface Props extends SVGIconProps {
  6. direction?: 'up' | 'right' | 'down' | 'left';
  7. }
  8. const IconPanel = forwardRef<SVGSVGElement, Props>(
  9. ({direction = 'up', ...props}, ref) => {
  10. const theme = useTheme();
  11. return (
  12. <SvgIcon
  13. {...props}
  14. ref={ref}
  15. style={{
  16. transform: direction
  17. ? `rotate(${theme.iconDirections[direction]}deg)`
  18. : undefined,
  19. }}
  20. >
  21. <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" />
  22. </SvgIcon>
  23. );
  24. }
  25. );
  26. IconPanel.displayName = 'IconPanel';
  27. export {IconPanel};