refactor common components out
This commit is contained in:
1 parent
1e7e7c7365
commit
e570b76d88
7 files changed
+30
-22
No files matched your search
@@ -1,14 +1,17 @@
|
||||
// Components
|
||||
import DataTable from "../../../../../Components/Table";
|
||||
import BarChart from "../../../../../Components/Charts/BarChart";
|
||||
import { Box } from "@mui/material";
|
||||
import { StatusLabel } from "../../../../../Components/Label";
|
||||
import Host from "../../../../../Components/Host";
|
||||
|
||||
//REFACTOR
|
||||
import Host from "../../../../Uptime/Monitors/Components/Host";
|
||||
import ActionsMenu from "../../../../Uptime/Monitors/Components/ActionsMenu";
|
||||
// Utils
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useMonitorUtils } from "../../../../../Hooks/useMonitorUtils";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
// Constants
|
||||
const TYPE_MAP = {
|
||||
distributed_http: "Distributed HTTP",
|
||||
};
|
||||
@@ -59,12 +62,7 @@ const MonitorTable = ({ isLoading, monitors }) => {
|
||||
{
|
||||
id: "actions",
|
||||
content: "Actions",
|
||||
render: (row) => (
|
||||
<ActionsMenu
|
||||
monitor={row.monitor}
|
||||
isAdmin={true}
|
||||
/>
|
||||
),
|
||||
render: (row) => <span>{"TODO"}</span>,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -88,4 +86,9 @@ const MonitorTable = ({ isLoading, monitors }) => {
|
||||
);
|
||||
};
|
||||
|
||||
MonitorTable.propTypes = {
|
||||
isLoading: PropTypes.bool,
|
||||
monitors: PropTypes.array,
|
||||
};
|
||||
|
||||
export default MonitorTable;
|
||||
@@ -8,15 +8,12 @@ import GenericFallback from "../../../Components/GenericFallback";
|
||||
|
||||
// Utils
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import { useSelector } from "react-redux";
|
||||
import { useIsAdmin } from "../../../Hooks/useIsAdmin";
|
||||
import { useSubscribeToMonitors } from "./Hooks/useSubscribeToMonitors";
|
||||
// Constants
|
||||
const BREADCRUMBS = [{ name: `Distributed Uptime`, path: "/distributed-uptime" }];
|
||||
|
||||
const DistributedUptimeMonitors = () => {
|
||||
// Redux state
|
||||
const { authToken, user } = useSelector((state) => state.auth);
|
||||
// Local state
|
||||
// Utils
|
||||
const theme = useTheme();
|
||||
|
||||
Reference in new issue
Block a user