From 2c53ec3e120baeb013e9e4093356691d0f7e023d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Mon, 30 Dec 2024 16:51:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E5=8F=96=E5=85=AC=E5=85=B1=E7=9A=84Op?= =?UTF-8?q?tion=E7=B1=BB=E5=9E=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/HSegmentedControl.tsx | 6 +----- src/models.ts | 4 ++++ 2 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 src/models.ts diff --git a/src/components/HSegmentedControl.tsx b/src/components/HSegmentedControl.tsx index 93a8e47..e42b7f7 100644 --- a/src/components/HSegmentedControl.tsx +++ b/src/components/HSegmentedControl.tsx @@ -1,13 +1,9 @@ import cx from 'clsx'; import { isEqual, isNil } from 'lodash-es'; import { useCallback, useRef, useState } from 'react'; +import type { Option } from '../models'; import styles from './HSegmentedControl.module.css'; -type Option = { - label: string; - value: string | number | null; -}; - type SegmentedConttrolProps = { options?: Option[]; value?: Option['value']; diff --git a/src/models.ts b/src/models.ts new file mode 100644 index 0000000..cf18ade --- /dev/null +++ b/src/models.ts @@ -0,0 +1,4 @@ +export type Option = { + label: string; + value: string | number | null; +};