metacubexd/src/components/ProxyCardGroups.tsx

21 lines
463 B
TypeScript
Raw Normal View History

import { For } from 'solid-js'
import { ProxyNodeCard } from '~/components'
2023-09-01 18:31:44 +08:00
export const ProxyCardGroups = (props: {
2023-09-03 06:08:53 +08:00
proxyNames: string[]
2023-09-01 18:37:19 +08:00
now?: string
onClick?: (name: string) => void
}) => {
2023-09-01 18:31:44 +08:00
return (
<For each={props.proxyNames}>
2023-09-01 18:31:44 +08:00
{(proxy) => (
2023-09-01 18:37:19 +08:00
<ProxyNodeCard
proxyName={proxy}
isSelected={props.now === proxy}
2023-09-07 10:41:42 +08:00
onClick={props.onClick && (() => props.onClick?.(proxy))}
2023-09-01 18:37:19 +08:00
/>
2023-09-01 18:31:44 +08:00
)}
</For>
2023-09-01 18:31:44 +08:00
)
}