mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-27 11:28:22 +03:00
11 lines
592 B
TypeScript
11 lines
592 B
TypeScript
import type { FC } from 'react';
|
|
import { DropdownBtn } from '../../../src/utils/DropdownBtn';
|
|
import type { DateIntervalDropdownProps } from './DateIntervalDropdownItems';
|
|
import { DateIntervalDropdownItems } from './DateIntervalDropdownItems';
|
|
import { rangeOrIntervalToString } from './helpers/dateIntervals';
|
|
|
|
export const DateIntervalSelector: FC<DateIntervalDropdownProps> = ({ onChange, active, allText }) => (
|
|
<DropdownBtn text={rangeOrIntervalToString(active) ?? allText}>
|
|
<DateIntervalDropdownItems allText={allText} active={active} onChange={onChange} />
|
|
</DropdownBtn>
|
|
);
|