import type { ExtendedChain } from '@lifi/sdk' import { Skeleton } from '@mui/material' import type { RefObject } from 'react' import { useTranslation } from 'react-i18next' import type { FormType } from '../../stores/form/types.js' import { SearchNotFound } from '../Search/SearchNotFound.js' import { List, ListItemAvatar, ListItemButton, ListItemText, } from './ChainList.style.js' import { VirtualizedChainList } from './VirtualizedChainList.js' interface ChainListProps { parentRef: RefObject formType: FormType chains: ExtendedChain[] onSelect: (chain: ExtendedChain) => void selectedChainId?: number isLoading: boolean hasSearchQuery: boolean inExpansion: boolean } export const ChainList = ({ parentRef, formType, chains, hasSearchQuery, onSelect, selectedChainId, isLoading, inExpansion, }: ChainListProps) => { const { t } = useTranslation() const itemsSize = inExpansion ? 'small' : 'medium' if (isLoading) { return ( {Array.from({ length: 3 }).map((_, index) => ( } size={itemsSize} /> ))} ) } if (!chains.length) { return ( ) } return ( ) }