mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-30 07:48:11 +01:00
24 lines
585 B
JavaScript
24 lines
585 B
JavaScript
import useDateRange from 'hooks/useDateRange';
|
|
import DateFilter from './DateFilter';
|
|
import styles from './WebsiteDateFilter.module.css';
|
|
|
|
export default function WebsiteDateFilter({ websiteId }) {
|
|
const [dateRange, setDateRange] = useDateRange(websiteId);
|
|
const { value, startDate, endDate } = dateRange;
|
|
|
|
const handleChange = async value => {
|
|
setDateRange(value);
|
|
};
|
|
|
|
return (
|
|
<DateFilter
|
|
className={styles.dropdown}
|
|
value={value}
|
|
startDate={startDate}
|
|
endDate={endDate}
|
|
onChange={handleChange}
|
|
showAllTime={true}
|
|
/>
|
|
);
|
|
}
|