diff --git a/moneymgr_web/src/App.tsx b/moneymgr_web/src/App.tsx index fc53ced..0d96867 100644 --- a/moneymgr_web/src/App.tsx +++ b/moneymgr_web/src/App.tsx @@ -14,6 +14,7 @@ import { OIDCCbRoute } from "./routes/auth/OIDCCbRoute"; import { BaseAuthenticatedPage } from "./widgets/BaseAuthenticatedPage"; import { BaseLoginPage } from "./widgets/BaseLoginPage"; import { TokensRoute } from "./routes/TokensRoute"; +import { AccountsRoute } from "./routes/AccountsRoute"; interface AuthContext { signedIn: boolean; @@ -39,6 +40,7 @@ export function App() { }> } /> } /> + } /> } /> diff --git a/moneymgr_web/src/routes/AccountsRoute.tsx b/moneymgr_web/src/routes/AccountsRoute.tsx new file mode 100644 index 0000000..531c850 --- /dev/null +++ b/moneymgr_web/src/routes/AccountsRoute.tsx @@ -0,0 +1,63 @@ +import { IconButton, Tooltip } from "@mui/material"; +import AddIcon from "@mui/icons-material/Add"; +import DeleteIcon from "@mui/icons-material/DeleteOutlined"; +import RefreshIcon from "@mui/icons-material/Refresh"; +import { MoneyMgrWebRouteContainer } from "../widgets/MoneyMgrWebRouteContainer"; +import { DataGrid, GridColDef } from "@mui/x-data-grid"; +import { useAccounts } from "../hooks/AccountsListProvider"; +import { TimeWidget } from "../widgets/TimeWidget"; + +export function AccountsRoute(): React.ReactElement { + const accounts = useAccounts(); + + const list = accounts.list.list; + + const columns: GridColDef<(typeof list)[number]>[] = [ + { field: "id", headerName: "ID", flex: 1 }, + { field: "name", headerName: "Name", flex: 6 }, + { + field: "time_create", + headerName: "Time created", + flex: 2, + renderCell(params) { + return ; + }, + }, + { + field: "time_update", + headerName: "Time updated", + flex: 2, + renderCell(params) { + return ; + }, + }, + { + field: "default_account", + headerName: "Default", + flex: 1, + type: "boolean", + }, + ]; + + return ( + + + + + + + + + + + + + } + > + + + ); +} diff --git a/moneymgr_web/src/widgets/MoneyNavList.tsx b/moneymgr_web/src/widgets/MoneyNavList.tsx index 20c08be..b1fb343 100644 --- a/moneymgr_web/src/widgets/MoneyNavList.tsx +++ b/moneymgr_web/src/widgets/MoneyNavList.tsx @@ -1,4 +1,4 @@ -import { mdiApi, mdiHome } from "@mdi/js"; +import { mdiApi, mdiCashMultiple, mdiHome } from "@mdi/js"; import Icon from "@mdi/react"; import { List, @@ -30,6 +30,12 @@ export function MoneyNavList(): React.ReactElement { uri="/tokens" icon={} /> + + } + /> ); }