Create base account route

This commit is contained in:
2025-04-19 22:13:19 +02:00
parent 394fbd50f0
commit 2a1b1ea45a
3 changed files with 30 additions and 1 deletions

View File

@ -0,0 +1,27 @@
import { useParams } from "react-router-dom";
import { MoneyMgrWebRouteContainer } from "../widgets/MoneyMgrWebRouteContainer";
import { useAccounts } from "../hooks/AccountsListProvider";
import { NotFoundRoute } from "./NotFound";
import { AccountWidget } from "../widgets/AccountWidget";
export function AccountRoute(): React.ReactElement {
const { accountId } = useParams();
const accounts = useAccounts();
const account = accounts.get(Number(accountId));
if (account === null) return <NotFoundRoute />;
return (
<MoneyMgrWebRouteContainer
label={
<span style={{ display: "inline-flex", alignItems: "center" }}>
<AccountWidget account={account} />
&nbsp;{account.name}
</span>
}
>
TODO : table
</MoneyMgrWebRouteContainer>
);
}