@lunit/oui
Version:
Lunit Oncology UI components
40 lines (39 loc) • 1.25 kB
TypeScript
import { SyntheticEvent } from 'react';
import { SliderProps } from '@mui/material';
import { SelectChangeEvent } from '@mui/material/Select';
import { ScoreProps } from '../Score';
import { StatisticProps } from '../Statistic';
export interface ThresholdOption {
title: string;
category: string;
value: number;
isPreset?: boolean;
}
export interface ThresholdSpec {
componentType: 'threshold';
totalScore: ScoreProps;
totalCells: StatisticProps;
statisticItems: StatisticProps[];
title?: string;
description?: {
preset: string;
user: string;
};
options: ThresholdOption[];
controlStep?: number;
}
export interface ThresholdProps extends ThresholdSpec {
thresholdState?: {
selectedItem: string;
sliderValue: number;
isPresetSelected: boolean;
};
onChangeDropdown: (event: SelectChangeEvent) => void;
onChangeSlider: (event: Event | SyntheticEvent, value: number | number[]) => void;
onSliderChangeCommitted: (event: Event | SyntheticEvent, value: number | number[]) => void;
onClickUpdateConfiguration: () => void;
isLoading?: boolean;
}
export interface BaseSliderProps extends SliderProps {
defaultThreshold: number;
}