Zone.jsx 862 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import React from "react";
  2. import { memo } from "react";
  3. import styled, { css } from "styled-components";
  4. const ZoneWrapper = styled.div`
  5. ${({ width = 200, height = 200 }) => css`
  6. width: ${width}px;
  7. height: ${height}px;
  8. border: 0.5em dotted #ccc;
  9. opacity: 0.2;
  10. border-radius: 1em;
  11. position: relative;
  12. & > div {
  13. font-size: 1.5em;
  14. letter-spacing: -3px;
  15. user-select: none;
  16. background-color: #ccc;
  17. position: absolute;
  18. padding: 1em 0em;
  19. top: 1em;
  20. left: -1em;
  21. border-radius: 0.5em;
  22. color: var(--color-darkGrey);
  23. writing-mode: vertical-rl;
  24. text-orientation: upright;
  25. }
  26. `}
  27. `;
  28. const Zone = ({ width, height, label }) => {
  29. return (
  30. <ZoneWrapper width={width} height={height}>
  31. <div>{label}</div>
  32. </ZoneWrapper>
  33. );
  34. };
  35. export default memo(Zone);