Skip to content

Commit

Permalink
feat: date range selector
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew committed Dec 17, 2024
1 parent 8080ff6 commit 4adcc6f
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions frontend/src/component/common/FilterDateItem/DateRangePresets.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
import { Box, List, ListItem, ListItemButton, Typography } from '@mui/material';
import {
Box,
List,
ListItem,
ListItemButton,
styled,
Typography,
} from '@mui/material';
import type { FilterItemParams } from '../../filter/FilterItem/FilterItem';
import type { FC } from 'react';
import { calculateDateRange, type RangeType } from './calculateDateRange';

export const PresetsHeader = styled(Typography)(({ theme }) => ({
paddingLeft: theme.spacing(2),
paddingBottom: theme.spacing(1),
}));

export const DateRangePresets: FC<{
onRangeChange: (value: {
from: FilterItemParams;
Expand All @@ -25,9 +37,7 @@ export const DateRangePresets: FC<{

return (
<Box>
<Typography variant='h3' sx={{ pb: 1, pl: 2 }}>
Presets
</Typography>
<PresetsHeader variant='h3'>Presets</PresetsHeader>
<List disablePadding sx={{ pb: 2 }}>
<ListItem disablePadding>
<ListItemButton onClick={rangeChangeHandler('thisMonth')}>
Expand Down

0 comments on commit 4adcc6f

Please sign in to comment.