mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-25 10:28:23 +03:00
12 lines
592 B
TypeScript
12 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>
|
||
|
);
|