import { Flex, Box, ToggleGroup, ToggleGroupItem, Text, } from 'components/primitives' import * as TooltipPrimitive from '@radix-ui/react-tooltip' import { useMounted } from 'hooks' import { useTheme } from 'next-themes' import { Dispatch, FC, SetStateAction } from 'react' import supportedChains from 'utils/chains' import { TooltipArrow } from 'components/primitives/Tooltip' type Props = { searchChain: string setSearchChain: Dispatch> } export const SearchChainSwitcher: FC = ({ searchChain, setSearchChain, }) => { const isMounted = useMounted() const { theme } = useTheme() if (!isMounted || supportedChains.length === 1) { return null } return ( {supportedChains.map((chainOption) => ( { setSearchChain(chainOption.routePrefix) }} css={{ backgroundColor: 'transparent', px: '$4', borderRadius: 0, width: '100%', zIndex: 9999, borderBottom: '1px solid $gray5', '&[data-state=on]': { backgroundColor: 'transparent', borderBottom: '2px solid $primary9', }, }} > {chainOption?.name} ))} ) }