feat: add агегку events
This commit is contained in:
@@ -38,9 +38,11 @@ function BreadcrumbTrail({ items }: { items: Crumb[] }) {
|
||||
|
||||
function AccountBreadcrumbs({
|
||||
accountId,
|
||||
events,
|
||||
operations,
|
||||
}: {
|
||||
accountId: string;
|
||||
events: boolean;
|
||||
operations: boolean;
|
||||
}) {
|
||||
const { accessToken } = useAuth();
|
||||
@@ -53,16 +55,22 @@ function AccountBreadcrumbs({
|
||||
return (
|
||||
<BreadcrumbTrail
|
||||
items={
|
||||
operations
|
||||
events
|
||||
? [
|
||||
{ label: t("breadcrumbs.accounts"), to: "/accounts" },
|
||||
{ label: accountName, to: accountPath },
|
||||
{ label: t("breadcrumbs.operations") },
|
||||
]
|
||||
: [
|
||||
{ label: t("breadcrumbs.accounts"), to: "/accounts" },
|
||||
{ label: accountName },
|
||||
{ label: t("breadcrumbs.events") },
|
||||
]
|
||||
: operations
|
||||
? [
|
||||
{ label: t("breadcrumbs.accounts"), to: "/accounts" },
|
||||
{ label: accountName, to: accountPath },
|
||||
{ label: t("breadcrumbs.operations") },
|
||||
]
|
||||
: [
|
||||
{ label: t("breadcrumbs.accounts"), to: "/accounts" },
|
||||
{ label: accountName },
|
||||
]
|
||||
}
|
||||
/>
|
||||
);
|
||||
@@ -74,6 +82,10 @@ export function AppBreadcrumbs() {
|
||||
path: "/accounts/:accountId/operations",
|
||||
end: true,
|
||||
});
|
||||
const accountEvents = useMatch({
|
||||
path: "/accounts/:accountId/events",
|
||||
end: true,
|
||||
});
|
||||
const account = useMatch({ path: "/accounts/:accountId", end: true });
|
||||
const accounts = useMatch({ path: "/accounts", end: true });
|
||||
const settings = useMatch({ path: "/settings", end: true });
|
||||
@@ -82,13 +94,23 @@ export function AppBreadcrumbs() {
|
||||
return (
|
||||
<AccountBreadcrumbs
|
||||
accountId={accountOperations.params.accountId ?? ""}
|
||||
events={false}
|
||||
operations
|
||||
/>
|
||||
);
|
||||
if (accountEvents)
|
||||
return (
|
||||
<AccountBreadcrumbs
|
||||
accountId={accountEvents.params.accountId ?? ""}
|
||||
events
|
||||
operations={false}
|
||||
/>
|
||||
);
|
||||
if (account)
|
||||
return (
|
||||
<AccountBreadcrumbs
|
||||
accountId={account.params.accountId ?? ""}
|
||||
events={false}
|
||||
operations={false}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user