import { twMerge } from 'tailwind-merge' import Delay from '~/components/Delay' import { DELAY } from '~/config/enum' import { useProxies } from '~/signals/proxies' export default (props: { proxyNameList: string[]; now?: string }) => { const { proxyNodeMap } = useProxies() const allNodesDelay = props.proxyNameList.map((i) => proxyNodeMap()[i].delay!) const all = allNodesDelay.length const good = allNodesDelay.filter( (delay) => delay > DELAY.NOT_CONNECTED && delay <= DELAY.MEDIUM, ).length const middle = allNodesDelay.filter( (delay) => delay > DELAY.MEDIUM && delay <= DELAY.HIGH, ).length const slow = allNodesDelay.filter((delay) => delay > DELAY.HIGH).length const notConnected = allNodesDelay.filter( (delay) => delay === DELAY.NOT_CONNECTED || typeof delay !== 'number', ).length return (