import { Button } from '@gear-js/ui'; import clsx from 'clsx'; import { CSSTransition } from 'react-transition-group'; import SimpleBar from 'simplebar-react'; import { AnimationTimeout } from '@/shared/config'; import plusSVG from '@/shared/assets/images/actions/plus.svg?react'; import closeSVG from '@/shared/assets/images/actions/close.svg?react'; import switchSVG from '@/shared/assets/images/actions/switch.svg?react'; import { NodeSection } from '@/entities/node'; import { Node as NodeItem } from '../node'; import styles from './NodesPopup.module.scss'; type Props = { chain: string | undefined; isLoading: boolean; nodeAddress: string | undefined; nodeSections: NodeSection[]; selectedNode: string; selectNode: (address: string) => void; removeNode: (address: string) => void; onSwitchButtonClick: () => void; onAddButtonClick: () => void; onCloseButtonClick: () => void; }; const NodesPopup = (props: Props) => { const { chain, isLoading, nodeAddress, nodeSections, selectedNode, selectNode, removeNode, onSwitchButtonClick, onAddButtonClick, onCloseButtonClick, } = props; const isCurrentNode = selectedNode === nodeAddress; const getNodes = (section: NodeSection) => section.nodes.map((node, index) => ( )); const getSections = () => nodeSections.map((section, index) => ( // eslint-disable-next-line react/no-array-index-key
  • {section.caption}

  • )); return ( ); }; export { NodesPopup };