mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-25 03:09:32 -06:00
FIX-1930 have made initial changes in order to proceed with rebuidling.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { Box, Stack, Typography } from "@mui/material";
|
||||
import PropTypes from "prop-types";
|
||||
import { useTheme } from "@emotion/react";
|
||||
import ConfigBox from "../../../../../Components/ConfigBox";
|
||||
|
||||
const ConfigRow = ({ title, description, children }) => {
|
||||
const theme = useTheme();
|
||||
|
||||
return (
|
||||
<ConfigBox>
|
||||
<Box>
|
||||
<Typography component="h2" variant="h2">
|
||||
{title}
|
||||
</Typography>
|
||||
{description && (
|
||||
<Typography variant="body2" mt={theme.spacing(2)}>
|
||||
{description}
|
||||
</Typography>
|
||||
)}
|
||||
</Box>
|
||||
<Stack gap={theme.spacing(15)} mt={theme.spacing(4)}>
|
||||
{children}
|
||||
</Stack>
|
||||
</ConfigBox>
|
||||
);
|
||||
};
|
||||
|
||||
ConfigRow.propTypes = {
|
||||
title: PropTypes.string.isRequired,
|
||||
description: PropTypes.string,
|
||||
children: PropTypes.node
|
||||
};
|
||||
|
||||
export default ConfigRow;
|
||||
@@ -0,0 +1,49 @@
|
||||
import PropTypes from "prop-types";
|
||||
import ConfigRow from "../ConfigRow";
|
||||
import Search from "../../../../../Components/Inputs/Search";
|
||||
import { useState } from "react";
|
||||
|
||||
const MonitorsConfig = ({
|
||||
monitors,
|
||||
selectedMonitors,
|
||||
error,
|
||||
isEditMode,
|
||||
onSelectMonitors,
|
||||
secondaryLabelText,
|
||||
}) => {
|
||||
const [search, setSearch] = useState("");
|
||||
const handleSearch = (value) => {
|
||||
setSearch(value);
|
||||
};
|
||||
|
||||
return (
|
||||
<ConfigRow title="Monitors to apply maintenance window to">
|
||||
<Search
|
||||
id={"monitors"}
|
||||
label="Add monitors"
|
||||
multiple={true}
|
||||
isAdorned={false}
|
||||
options={monitors || []}
|
||||
filteredBy="name"
|
||||
secondaryLabel={secondaryLabelText}
|
||||
inputValue={search}
|
||||
value={selectedMonitors}
|
||||
handleInputChange={handleSearch}
|
||||
handleChange={onSelectMonitors}
|
||||
error={error}
|
||||
disabled={isEditMode}
|
||||
/>
|
||||
</ConfigRow>
|
||||
);
|
||||
};
|
||||
|
||||
MonitorsConfig.propTypes = {
|
||||
monitors: PropTypes.array.isRequired,
|
||||
selectedMonitors: PropTypes.array.isRequired,
|
||||
error: PropTypes.string,
|
||||
isEditMode: PropTypes.bool.isRequired,
|
||||
onSelectMonitors: PropTypes.func.isRequired,
|
||||
secondaryLabelText: PropTypes.string,
|
||||
};
|
||||
|
||||
export default MonitorsConfig;
|
||||
Reference in New Issue
Block a user