import { useI18n } from '@solid-primitives/i18n' import { IconBrandSpeedtest } from '@tabler/icons-solidjs' import { Show, createSignal } from 'solid-js' import Collapse from '~/components/Collpase' import ForTwoLine from '~/components/ForTwoLine' import ProxyCardGroups from '~/components/ProxyCardGroups' import ProxyNodePreview from '~/components/ProxyNodePreview' import { useProxies } from '~/signals/proxies' import type { Proxy } from '~/types' export default () => { const [t] = useI18n() const { proxies, setProxyGroupByProxyName, delayTestByProxyGroupName } = useProxies() const [collapsedMap, setCollapsedMap] = createSignal>( {}, ) const onProxyNodeClick = async (proxy: Proxy, proxyName: string) => { setProxyGroupByProxyName(proxy, proxyName) } const onSpeedTestClick = async (e: MouseEvent, name: string) => { const el = e.target as HTMLElement el.classList.add('animate-pulse') e.stopPropagation() await delayTestByProxyGroupName(name) el.classList.remove('animate-pulse') } return (

{t('proxies')}

{ const title = ( <>
{proxy.name}
{proxy.type} :: {proxy.now}
) const content = ( { onProxyNodeClick(proxy, name) }} /> ) return ( setCollapsedMap({ ...collapsedMap(), [`group-${proxy.name}`]: val, }) } /> ) })} />
) }