import * as React from "react";
import {
Box,
Container,
CircularProgress,
Alert
} from "@mui/material";
import ConfigurableDashboard from "./components/Dashboard";
import { configuration } from "./dashboard-config";
import {
useReport,
prepareReport,
} from "./features/report";
export default function Dashboard() {
const report = useReport({
periods: ["weekly", "monthly", "full"],
rolling: true,
include_transactions: true,
group_by: ["tags"],
})
const isLoading = report.isLoading;
const error = report.error;
if (isLoading) {
return (
);
}
if (error) {
return (
{String(error)}
);
}
if (!report) {
return null;
}
const data = prepareReport(report.data?.data);
return (
);
}