import React from 'react'; import styled from '@emotion/styled'; import { Flex, Box } from 'reflexbox'; import Link from 'gatsby-link'; import ReactFlow, { ReactFlowProvider, Background, Controls, MiniMap, } from 'react-flow-renderer'; import { H2, Text } from 'components/Typo'; import Icon from 'components/Icon'; import { baseColors } from 'themes'; import { device, getThemeSpacePx } from 'utils/css-utils'; const Wrapper = styled(Flex)` justify-content: space-between; align-items: center; flex-wrap: wrap; `; const ReactFlowWrapper = styled(Box)` height: 400px; background: ${(p) => (p.isDark ? baseColors.violet : 'white')}; border-radius: 5px; order: 2; @media ${device.tablet} { order: ${(p) => p.order}; } .react-flow__controls { opacity: ${(p) => (p.isDark ? 0.5 : 1)}; } `; const DocsLink = styled(Link)` display: flex; align-items: center; margin-top: 16px; `; const DescriptionWrapper = styled(Box)` order: 1; margin-bottom: ${getThemeSpacePx(3)}; @media ${device.tablet} { order: ${(p) => p.order}; } `; const Description = ({ title, description }) => (

{title}

{description} Documentation{' '}
); export default ({ title, description, textPosition = 'left', flowProps, withControls = false, withMinimap = false, isDark = false, linesBg = false, children, }) => { const bgColor = isDark ? baseColors.violetLighten60 : baseColors.violet; const reactFlowOrder = textPosition === 'left' ? 2 : 1; return ( {textPosition === 'left' && ( )} {children ? ( children ) : ( {withControls && } {withMinimap && } )} {textPosition !== 'left' && ( )} ); };