blob: f5c3cbf184953ff0798f4fa0c563a5d2948290bb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
import * as React from 'react';
import { ProxyProvider } from '~/components/proxies/ProxyProvider';
import { DelayMapping, DispatchFn, FormattedProxyProvider, ProxiesMapping } from '~/store/types';
import { ClashAPIConfig } from '~/types';
export function ProxyProviderList({
items,
delay,
proxies,
latencyTestUrl,
hideUnavailableProxies,
proxySortBy,
dispatch,
apiConfig,
collapsibleIsOpen,
}: {
items: FormattedProxyProvider[];
delay: DelayMapping;
proxies: ProxiesMapping;
latencyTestUrl: string;
hideUnavailableProxies: boolean;
proxySortBy: string;
dispatch: DispatchFn;
apiConfig: ClashAPIConfig;
collapsibleIsOpen: Record<string, boolean>;
}) {
if (items.length === 0) return null;
return (
<div>
{items.map((item) => (
<ProxyProvider
key={item.name}
name={item.name}
proxies={item.proxies}
type={item.type}
vehicleType={item.vehicleType}
updatedAt={item.updatedAt}
subscriptionInfo={item.subscriptionInfo}
proxyMapping={proxies}
latencyTestUrl={latencyTestUrl}
delay={delay}
hideUnavailableProxies={hideUnavailableProxies}
proxySortBy={proxySortBy}
dispatch={dispatch}
apiConfig={apiConfig}
isOpen={Boolean(collapsibleIsOpen[`proxyProvider:${item.name}`])}
/>
))}
</div>
);
}
|