提取公共的Option类型。

This commit is contained in:
徐涛 2024-12-30 16:51:05 +08:00
parent a83af72af6
commit 2c53ec3e12
2 changed files with 5 additions and 5 deletions

View File

@ -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'];

4
src/models.ts Normal file
View File

@ -0,0 +1,4 @@
export type Option = {
label: string;
value: string | number | null;
};