minor fixes
This commit is contained in:
@@ -3,6 +3,8 @@ import { RadioGroup, RadioGroupItem } from "../ui/radio-group";
|
||||
import { changeDateRanges, changeInterval } from "./reportSlice";
|
||||
import { Combobox } from "../ui/combobox";
|
||||
import { type IInterval } from "@/types";
|
||||
import { timeRanges } from "@/utils/constants";
|
||||
import { entries } from "@/utils/object";
|
||||
|
||||
export function ReportDateRange() {
|
||||
const dispatch = useDispatch();
|
||||
@@ -12,62 +14,17 @@ export function ReportDateRange() {
|
||||
return (
|
||||
<>
|
||||
<RadioGroup>
|
||||
<RadioGroupItem
|
||||
onClick={() => {
|
||||
dispatch(changeDateRanges("today"));
|
||||
}}
|
||||
>
|
||||
Today
|
||||
</RadioGroupItem>
|
||||
<RadioGroupItem
|
||||
onClick={() => {
|
||||
dispatch(changeDateRanges(1));
|
||||
}}
|
||||
>
|
||||
24 hours
|
||||
</RadioGroupItem>
|
||||
<RadioGroupItem
|
||||
onClick={() => {
|
||||
dispatch(changeDateRanges(7));
|
||||
}}
|
||||
>
|
||||
7 days
|
||||
</RadioGroupItem>
|
||||
<RadioGroupItem
|
||||
onClick={() => {
|
||||
dispatch(changeDateRanges(14));
|
||||
}}
|
||||
>
|
||||
14 days
|
||||
</RadioGroupItem>
|
||||
<RadioGroupItem
|
||||
onClick={() => {
|
||||
dispatch(changeDateRanges(30));
|
||||
}}
|
||||
>
|
||||
1 month
|
||||
</RadioGroupItem>
|
||||
<RadioGroupItem
|
||||
onClick={() => {
|
||||
dispatch(changeDateRanges(90));
|
||||
}}
|
||||
>
|
||||
3 month
|
||||
</RadioGroupItem>
|
||||
<RadioGroupItem
|
||||
onClick={() => {
|
||||
dispatch(changeDateRanges(180));
|
||||
}}
|
||||
>
|
||||
6 month
|
||||
</RadioGroupItem>
|
||||
<RadioGroupItem
|
||||
onClick={() => {
|
||||
dispatch(changeDateRanges(356));
|
||||
}}
|
||||
>
|
||||
1 year
|
||||
</RadioGroupItem>
|
||||
{entries(timeRanges).map(([range, title]) => (
|
||||
<RadioGroupItem
|
||||
key={range}
|
||||
// active={range === interval}
|
||||
onClick={() => {
|
||||
dispatch(changeDateRanges(range));
|
||||
}}
|
||||
>
|
||||
{title}
|
||||
</RadioGroupItem>
|
||||
))}
|
||||
</RadioGroup>
|
||||
{chartType === "linear" && (
|
||||
<div className="w-full max-w-[200px]">
|
||||
|
||||
Reference in New Issue
Block a user