TextNode.tsx 593 B

12345678910111213141516171819202122
  1. import React from "react";
  2. import { CustomNodeProps } from ".";
  3. import * as Styled from "./styles";
  4. const BondNode: React.FC<CustomNodeProps<string>> = ({
  5. width,
  6. height,
  7. value,
  8. isParent = false,
  9. }) => {
  10. return (
  11. <Styled.StyledForeignObject width={width} height={height} x={0} y={0}>
  12. <Styled.StyledTextWrapper>
  13. <Styled.StyledText width={width} height={height}>
  14. <Styled.StyledKey parent={isParent}>{value}</Styled.StyledKey>
  15. </Styled.StyledText>
  16. </Styled.StyledTextWrapper>
  17. </Styled.StyledForeignObject>
  18. );
  19. };
  20. export default BondNode;