import { createMemo } from 'solid-js' import { twMerge } from 'tailwind-merge' import { useProxies } from '~/signals/proxies' export default (props: { proxyName: string isSelected?: boolean onClick?: () => void }) => { const { proxyName, isSelected, onClick } = props const { delayMap, proxyNodeMap } = useProxies() const proxyNode = createMemo(() => proxyNodeMap()[proxyName]) const Delay = (proxyname: string) => { const delay = delayMap()[proxyname] let textClassName = 'text-green-500' if (typeof delay !== 'number' || delay === 0) { return '' } if (delay > 500) { textClassName = 'text-red-500' } else if (delay > 200) { textClassName = 'text-yellow-500' } return {delay}ms } return (