2024-07-26 12:39:18 -04:00
|
|
|
import PropTypes from "prop-types";
|
|
|
|
|
import { Stack, Box, Typography, Grid } from "@mui/material";
|
|
|
|
|
import Button from "../../Components/Button";
|
|
|
|
|
import { useTheme } from "@emotion/react";
|
2024-05-22 17:14:34 -04:00
|
|
|
|
2024-07-26 12:39:18 -04:00
|
|
|
import "./index.css";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Integrations component
|
|
|
|
|
* @param {Object} props - Props for the IntegrationsComponent.
|
|
|
|
|
* @param {string} props.url - The URL for the integration image.
|
|
|
|
|
* @param {string} props.header - The header for the integration.
|
|
|
|
|
* @param {string} props.info - Information about the integration.
|
|
|
|
|
* @param {Function} props.onClick - The onClick handler for the integration button.
|
|
|
|
|
* @returns {JSX.Element} The JSX representation of the IntegrationsComponent.
|
|
|
|
|
*/
|
|
|
|
|
const IntegrationsComponent = ({ url, header, info, onClick }) => {
|
|
|
|
|
const theme = useTheme();
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Grid item lg={6} flexGrow={1}>
|
|
|
|
|
<Stack
|
|
|
|
|
direction="row"
|
|
|
|
|
justifyContent="space-between"
|
|
|
|
|
gap={theme.gap.large}
|
2024-07-28 16:51:47 -04:00
|
|
|
p={theme.gap.ml}
|
2024-07-26 12:39:18 -04:00
|
|
|
>
|
|
|
|
|
<Box
|
|
|
|
|
component="img"
|
|
|
|
|
src={url}
|
|
|
|
|
alt="Integration"
|
|
|
|
|
width={80}
|
|
|
|
|
height={80}
|
|
|
|
|
/>
|
|
|
|
|
<Stack gap={theme.gap.xs} flex={1}>
|
|
|
|
|
<Typography component="h1">{header}</Typography>
|
|
|
|
|
<Typography
|
|
|
|
|
sx={{
|
|
|
|
|
maxWidth: "300px",
|
|
|
|
|
wordWrap: "break-word",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{info}
|
|
|
|
|
</Typography>
|
|
|
|
|
</Stack>
|
|
|
|
|
<Button
|
|
|
|
|
label="Add"
|
|
|
|
|
level="primary"
|
|
|
|
|
onClick={onClick}
|
|
|
|
|
sx={{ alignSelf: "center" }}
|
|
|
|
|
/>
|
|
|
|
|
</Stack>
|
|
|
|
|
</Grid>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// PropTypes for IntegrationsComponent
|
|
|
|
|
IntegrationsComponent.propTypes = {
|
|
|
|
|
url: PropTypes.string.isRequired,
|
|
|
|
|
header: PropTypes.string.isRequired,
|
|
|
|
|
info: PropTypes.string.isRequired,
|
|
|
|
|
onClick: PropTypes.func.isRequired,
|
|
|
|
|
};
|
2024-05-22 17:14:34 -04:00
|
|
|
|
2024-06-09 23:37:47 -07:00
|
|
|
/**
|
|
|
|
|
* Integrations Page Component
|
2024-06-10 12:44:10 -07:00
|
|
|
* @returns {JSX.Element} The JSX representation of the Integrations page.
|
2024-06-09 23:37:47 -07:00
|
|
|
*/
|
2024-07-26 12:39:18 -04:00
|
|
|
|
2024-05-22 17:14:34 -04:00
|
|
|
const Integrations = () => {
|
2024-06-10 12:44:10 -07:00
|
|
|
const theme = useTheme();
|
|
|
|
|
|
|
|
|
|
const integrations = [
|
2024-07-26 12:39:18 -04:00
|
|
|
{
|
|
|
|
|
url: "https://via.placeholder.com/80",
|
|
|
|
|
header: "Slack",
|
|
|
|
|
info: "Connect with Slack and see incidents in a channel",
|
|
|
|
|
onClick: () => {},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
url: "https://via.placeholder.com/80",
|
|
|
|
|
header: "Discord",
|
|
|
|
|
info: "Connect with Discord and view incidents directly in a channel",
|
|
|
|
|
onClick: () => {},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
url: "https://via.placeholder.com/80",
|
|
|
|
|
header: "Zapier",
|
|
|
|
|
info: "Send all incidents to Zapier, and then see them everywhere",
|
|
|
|
|
onClick: () => {},
|
2024-06-10 12:44:10 -07:00
|
|
|
},
|
|
|
|
|
// Add more integrations as needed
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
return (
|
2024-07-26 12:39:18 -04:00
|
|
|
<Stack className="integrations" gap={theme.gap.xs}>
|
|
|
|
|
<Typography component="h1">Integrations</Typography>
|
2024-07-28 16:51:47 -04:00
|
|
|
<Typography mb={theme.gap.large}>
|
|
|
|
|
Connect Uptime Genie to your favorite service
|
|
|
|
|
</Typography>
|
|
|
|
|
<Grid container spacing={theme.gap.large}>
|
2024-06-10 12:44:10 -07:00
|
|
|
{integrations.map((integration, index) => (
|
2024-07-26 12:39:18 -04:00
|
|
|
<IntegrationsComponent
|
2024-06-10 12:44:10 -07:00
|
|
|
key={index}
|
|
|
|
|
url={integration.url}
|
|
|
|
|
header={integration.header}
|
|
|
|
|
info={integration.info}
|
|
|
|
|
onClick={integration.onClick}
|
|
|
|
|
/>
|
|
|
|
|
))}
|
2024-07-26 12:39:18 -04:00
|
|
|
</Grid>
|
|
|
|
|
</Stack>
|
2024-06-10 12:44:10 -07:00
|
|
|
);
|
|
|
|
|
};
|
2024-05-22 17:14:34 -04:00
|
|
|
|
2024-06-10 12:44:10 -07:00
|
|
|
export default Integrations;
|