From 9a6db8b8de4fd1947191c147105c57c4a7c24b36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Mon, 30 Dec 2024 16:53:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=AD=A3Props=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/HSegmentedControl.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/HSegmentedControl.tsx b/src/components/HSegmentedControl.tsx index e42b7f7..f45f169 100644 --- a/src/components/HSegmentedControl.tsx +++ b/src/components/HSegmentedControl.tsx @@ -4,13 +4,13 @@ import { useCallback, useRef, useState } from 'react'; import type { Option } from '../models'; import styles from './HSegmentedControl.module.css'; -type SegmentedConttrolProps = { +type HSegmentedControlProps = { options?: Option[]; value?: Option['value']; onChange?: (value: Option['value']) => void; }; -export function HSegmentedControl({ options = [], value, onChange }: SegmentedConttrolProps) { +export function HSegmentedControl({ options = [], value, onChange }: HSegmentedControlProps) { const [selected, setSelected] = useState(value ?? options[0].value ?? null); const [sliderPosition, setSliderPosition] = useState(0); const [sliderWidth, setSliderWidth] = useState(0);