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-07-31 19:20:50 -04:00
|
|
|
import Discord from "../../assets/icons/discord-icon.svg?react";
|
|
|
|
|
import Slack from "../../assets/icons/slack-icon.svg?react";
|
|
|
|
|
import Zapier from "../../assets/icons/zapier-icon.svg?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.
|
2024-07-31 19:20:50 -04:00
|
|
|
* @param {string} props.icon - The icon for the integration image.
|
2024-07-26 12:39:18 -04:00
|
|
|
* @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.
|
|
|
|
|
*/
|
2024-07-31 19:20:50 -04:00
|
|
|
const IntegrationsComponent = ({ icon, header, info, onClick }) => {
|
2024-07-26 12:39:18 -04:00
|
|
|
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-31 19:20:50 -04:00
|
|
|
pl={theme.gap.large}
|
|
|
|
|
height="100%"
|
2024-07-26 12:39:18 -04:00
|
|
|
>
|
2024-07-31 19:20:50 -04:00
|
|
|
<Stack alignItems="center" justifyContent="center">
|
|
|
|
|
{icon}
|
|
|
|
|
</Stack>
|
2024-07-26 12:39:18 -04:00
|
|
|
<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" }}
|
2024-07-31 19:20:50 -04:00
|
|
|
disabled={true}
|
2024-07-26 12:39:18 -04:00
|
|
|
/>
|
|
|
|
|
</Stack>
|
|
|
|
|
</Grid>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// PropTypes for IntegrationsComponent
|
|
|
|
|
IntegrationsComponent.propTypes = {
|
2024-07-31 19:20:50 -04:00
|
|
|
icon: PropTypes.object.isRequired,
|
2024-07-26 12:39:18 -04:00
|
|
|
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
|
|
|
{
|
2024-07-31 19:20:50 -04:00
|
|
|
icon: (
|
|
|
|
|
<Slack
|
|
|
|
|
alt="slack integration"
|
|
|
|
|
style={{ width: "45px", height: "45px" }}
|
|
|
|
|
/>
|
|
|
|
|
),
|
2024-07-26 12:39:18 -04:00
|
|
|
header: "Slack",
|
|
|
|
|
info: "Connect with Slack and see incidents in a channel",
|
|
|
|
|
onClick: () => {},
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-07-31 19:20:50 -04:00
|
|
|
icon: (
|
|
|
|
|
<Discord
|
|
|
|
|
alt="discord integration"
|
|
|
|
|
style={{ width: "42px", height: "42px" }}
|
|
|
|
|
/>
|
|
|
|
|
),
|
2024-07-26 12:39:18 -04:00
|
|
|
header: "Discord",
|
|
|
|
|
info: "Connect with Discord and view incidents directly in a channel",
|
|
|
|
|
onClick: () => {},
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-07-31 19:20:50 -04:00
|
|
|
icon: (
|
|
|
|
|
<Zapier
|
|
|
|
|
alt="zapier integration"
|
|
|
|
|
style={{ width: "42px", height: "42px" }}
|
|
|
|
|
/>
|
|
|
|
|
),
|
2024-07-26 12:39:18 -04:00
|
|
|
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}
|
2024-07-31 19:20:50 -04:00
|
|
|
icon={integration.icon}
|
2024-06-10 12:44:10 -07:00
|
|
|
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;
|