import { useI18n } from '@solid-primitives/i18n' import { IconBrandSpeedtest } from '@tabler/icons-solidjs' import { Show, createSignal } from 'solid-js' import { Button } from '~/components/Button' import Collapse from '~/components/Collpase' import ForTwoColumns from '~/components/ForTwoColumns' import ProxyCardGroups from '~/components/ProxyCardGroups' import ProxyNodePreview from '~/components/ProxyNodePreview' import { useProxies } from '~/signals/proxies' import type { Proxy } from '~/types' import { getBtnElFromClickEvent } from '~/utils/proxies' 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 = getBtnElFromClickEvent(e) 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, }) } /> ) })} />
) }