import React, { useContext } from 'react' import { Box, Button, Flex, Menu, MenuButton, MenuItem, MenuList, Portal, Text, } from '@chakra-ui/react' import { ChevronDownIcon } from '@chakra-ui/icons' import { initialColoring } from '../../config' export interface GraphColorSelectProps { coloring: typeof initialColoring setColoring: any } export const GraphColorSelect = (props: GraphColorSelectProps) => { type Theme = { [key: string]: string } const { coloring, setColoring } = props return ( Graph coloring } > {coloring.method === 'degree' ? 'Links' : 'Communities'} setColoring((curr: typeof initialColoring) => ({ ...curr, method: 'degree' })) } justifyContent="space-between" alignItems="center" display="flex" > Number of links setColoring((curr: typeof initialColoring) => ({ ...curr, method: 'community' })) } justifyContent="space-between" alignItems="center" display="flex" > Communities ) }