提取公共的Option类型。
This commit is contained in:
parent
a83af72af6
commit
2c53ec3e12
|
@ -1,13 +1,9 @@
|
||||||
import cx from 'clsx';
|
import cx from 'clsx';
|
||||||
import { isEqual, isNil } from 'lodash-es';
|
import { isEqual, isNil } from 'lodash-es';
|
||||||
import { useCallback, useRef, useState } from 'react';
|
import { useCallback, useRef, useState } from 'react';
|
||||||
|
import type { Option } from '../models';
|
||||||
import styles from './HSegmentedControl.module.css';
|
import styles from './HSegmentedControl.module.css';
|
||||||
|
|
||||||
type Option = {
|
|
||||||
label: string;
|
|
||||||
value: string | number | null;
|
|
||||||
};
|
|
||||||
|
|
||||||
type SegmentedConttrolProps = {
|
type SegmentedConttrolProps = {
|
||||||
options?: Option[];
|
options?: Option[];
|
||||||
value?: Option['value'];
|
value?: Option['value'];
|
||||||
|
|
4
src/models.ts
Normal file
4
src/models.ts
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
export type Option = {
|
||||||
|
label: string;
|
||||||
|
value: string | number | null;
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user