Optimize code

This commit is contained in:
2024-01-03 15:16:48 +08:00
parent d67aea2895
commit bcd7b761ac
10 changed files with 609 additions and 593 deletions

View File

@@ -8,9 +8,7 @@ interface IndicatorProps {
onSwitch?: (index: number) => void
}
const Indicator: React.FC<IndicatorProps> = (props) => {
const { total, current, onSwitch } = props
const Indicator: React.FC<IndicatorProps> = ({ total, current, onSwitch }) => {
const handleClick = (index: number) => {
return () => {
onSwitch && onSwitch(index)