Skip to content

Commit

Permalink
mod: tiemSelect (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolaCage committed Oct 13, 2022
1 parent b3380be commit f1a026f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/TimeSelect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ import styles from './index.module.less';
interface IProps {
value?: TIME_OPTION_TYPE | number[];
onChange?: (value: any) => void;
timeOptions?: any[];
}

const TimeSelect = (props: IProps) => {

const { value, onChange } = props;
const { value, timeOptions, onChange } = props;

const [curTimeOption, setCurTimeOption ] = useState<TIME_OPTION_TYPE>();

Expand Down Expand Up @@ -61,7 +62,7 @@ const TimeSelect = (props: IProps) => {
onChange={handleTimeButtonClick}
value={curTimeOption}
>
{TIMEOPTIONS.map(option => (
{(timeOptions||TIMEOPTIONS).map(option => (
<Radio.Button key={option.value} value={option.name}>
{intl.get(`component.dashboardDetail.${option.name}`)}
</Radio.Button>
Expand Down

0 comments on commit f1a026f

Please sign in to comment.