Check the StatsDashboard.tsx page and the filters/DateFilter.tsx component to get an idea of how the filters are going to work. Essentially:
Each filter has...
an id - a unique identifier for the filter used to remove or update it
a component that is displayed in the filter bar, displays the state of its filter, and can be clicked on to modify or remove the filter.
an operation - a function that takes an incident and returns a boolean. If the incident passes the filter, the function should return true.
You will need to make a new file, probably starting with a copy of filters/DateFilter.tsx. You'll also need to add your component to the filters/AddFilter.tsx component's list so it can be used.
Your filter is based on incident date. The user should be able to choose a single date or range of dates, and incidents will only pass the operation if their date is on, before, or after the chosen single date, or between the chosen two dates.
Here are some UI ideas. I don't expect you to implement the calendar view unless you're feeling exceptionally motivated.
Check the
StatsDashboard.tsx
page and thefilters/DateFilter.tsx
component to get an idea of how the filters are going to work. Essentially:You will need to make a new file, probably starting with a copy of
filters/DateFilter.tsx
. You'll also need to add your component to thefilters/AddFilter.tsx
component's list so it can be used.Your filter is based on incident date. The user should be able to choose a single date or range of dates, and incidents will only pass the operation if their date is on, before, or after the chosen single date, or between the chosen two dates.
Here are some UI ideas. I don't expect you to implement the calendar view unless you're feeling exceptionally motivated.