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 = {
title: JSX.Element
content: JSX.Element
isOpen: boolean | undefined
isOpen?: boolean
onCollapse: (collapsed: boolean) => void
}

View File

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

View File

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