Add Breadcrumbs component to status page for improved navigation
This commit is contained in:
1 parent
c6ef77a886
commit
68354aac06
2 files changed
+21
-1
No files matched your search
@@ -3,6 +3,7 @@ import { Stack, Button, Typography } from "@mui/material";
|
||||
import Tabs from "./Components/Tabs";
|
||||
import GenericFallback from "../../../Components/GenericFallback";
|
||||
import SkeletonLayout from "./Components/Skeleton";
|
||||
import Breadcrumbs from "../../../Components/Breadcrumbs/index.jsx";
|
||||
//Utils
|
||||
import { useTheme } from "@emotion/react";
|
||||
import { useState, useEffect, useRef, useCallback } from "react";
|
||||
@@ -58,6 +59,19 @@ const CreateStatusPage = () => {
|
||||
|
||||
const [statusPage, statusPageMonitors, statusPageIsLoading, statusPageNetworkError] =
|
||||
useStatusPageFetch(isCreate, url);
|
||||
|
||||
// Breadcrumbs
|
||||
const crumbs = [
|
||||
{ name: "status pages", path: "/status" },
|
||||
];
|
||||
if (isCreate) {
|
||||
crumbs.push({ name: "create", path: "/status/create" });
|
||||
} else {
|
||||
crumbs.push(
|
||||
{ name: "details", path: `/status/uptime/${statusPage?.url}` },
|
||||
{ name: "configure", path: "" }
|
||||
);
|
||||
}
|
||||
|
||||
// Handlers
|
||||
const handleFormChange = (e) => {
|
||||
@@ -218,6 +232,7 @@ const CreateStatusPage = () => {
|
||||
// Load fields
|
||||
return (
|
||||
<Stack gap={theme.spacing(10)}>
|
||||
<Breadcrumbs list={crumbs} />
|
||||
<Tabs
|
||||
form={form}
|
||||
errors={errors}
|
||||
|
||||
Reference in new issue
Block a user