refactor: undefined

This commit is contained in:
Zephyruso 2023-09-07 10:41:42 +08:00
parent f72976154d
commit f56e82a9e1
3 changed files with 3 additions and 6 deletions

View File

@ -5,7 +5,7 @@ import { renderInTwoColumns } from '~/signals'
type Props = { type Props = {
title: JSX.Element title: JSX.Element
content: JSX.Element content: JSX.Element
isOpen: boolean | undefined isOpen?: boolean
onCollapse: (collapsed: boolean) => void onCollapse: (collapsed: boolean) => void
} }

View File

@ -20,7 +20,7 @@ export const ProxyCardGroups = (props: {
<ProxyNodeCard <ProxyNodeCard
proxyName={proxy} proxyName={proxy}
isSelected={props.now === proxy} isSelected={props.now === proxy}
onClick={props.onClick ? () => props.onClick?.(proxy!) : undefined} onClick={props.onClick && (() => props.onClick?.(proxy))}
/> />
)} )}
</InfiniteScroll> </InfiniteScroll>

View File

@ -3,10 +3,7 @@ import { twMerge } from 'tailwind-merge'
import { Latency } from '~/components' import { Latency } from '~/components'
import { latencyQualityMap, useProxies } from '~/signals' import { latencyQualityMap, useProxies } from '~/signals'
const LatencyDots = (props: { const LatencyDots = (props: { latency?: number; selected: boolean }) => {
latency: number | undefined
selected: boolean
}) => {
let dotClassName = props.selected let dotClassName = props.selected
? 'bg-white border-4 border-success' ? 'bg-white border-4 border-success'
: 'bg-success' : 'bg-success'