Merge pull request #16 from uprockcom/feat/chatbot
feat: chatbot, resolves #13
This commit is contained in:
4 files changed
+70
-8
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
const Dot = ({ color = "gray", size = "4px" }) => {
|
const Dot = ({ color = "gray", size = "4px", style }) => {
|
||||||
return (
|
return (
|
||||||
<span
|
<span
|
||||||
style={{
|
style={{
|
||||||
@@ -10,6 +10,7 @@ const Dot = ({ color = "gray", size = "4px" }) => {
|
|||||||
borderRadius: "50%",
|
borderRadius: "50%",
|
||||||
backgroundColor: color,
|
backgroundColor: color,
|
||||||
opacity: 0.8,
|
opacity: 0.8,
|
||||||
|
...style,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
// Components
|
||||||
|
import { Stack, Typography } from "@mui/material";
|
||||||
|
import { ColContainer } from "../../../../../Components/StandardContainer";
|
||||||
|
import SmartToyIcon from "@mui/icons-material/SmartToy";
|
||||||
|
import Dot from "../../../../../Components/Dot";
|
||||||
|
// Utils
|
||||||
|
import { useTheme } from "@emotion/react";
|
||||||
|
|
||||||
|
const MESSAGES = [
|
||||||
|
"I've checked the network status, and we're seeing excellent performance across all regions.",
|
||||||
|
"The network is stable and functioning optimally. All connections are active and stable.",
|
||||||
|
"I've reviewed the network status, and everything looks great. No issues detected.",
|
||||||
|
"The network is up and running smoothly. All connections are active and stable.",
|
||||||
|
"I've checked the network status, and everything is looking good. No issues detected.",
|
||||||
|
];
|
||||||
|
|
||||||
|
const ChatBot = ({ sx }) => {
|
||||||
|
const theme = useTheme();
|
||||||
|
return (
|
||||||
|
<ColContainer
|
||||||
|
backgroundColor={theme.palette.chatbot.background}
|
||||||
|
sx={{ ...sx }}
|
||||||
|
>
|
||||||
|
<Stack
|
||||||
|
direction="row"
|
||||||
|
alignItems="center"
|
||||||
|
gap={theme.spacing(4)}
|
||||||
|
>
|
||||||
|
<SmartToyIcon sx={{ color: theme.palette.chatbot.textAccent }} />
|
||||||
|
<Typography color={theme.palette.chatbot.textAccent}>Status Bot</Typography>
|
||||||
|
<Dot
|
||||||
|
color={theme.palette.chatbot.textAccent}
|
||||||
|
style={{ opacity: 0.4 }}
|
||||||
|
/>
|
||||||
|
<Typography
|
||||||
|
variant="body2"
|
||||||
|
color={theme.palette.chatbot.textAccent}
|
||||||
|
sx={{ opacity: 0.4 }}
|
||||||
|
>
|
||||||
|
Now
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
<Typography>{MESSAGES[Math.floor(Math.random() * MESSAGES.length)]}</Typography>
|
||||||
|
</ColContainer>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ChatBot;
|
||||||
@@ -3,6 +3,7 @@ import { ColContainer } from "../../../../../Components/StandardContainer";
|
|||||||
import { Stack, Typography } from "@mui/material";
|
import { Stack, Typography } from "@mui/material";
|
||||||
import PulseDot from "../../../../../Components/Animated/PulseDot";
|
import PulseDot from "../../../../../Components/Animated/PulseDot";
|
||||||
import LastUpdate from "../LastUpdate";
|
import LastUpdate from "../LastUpdate";
|
||||||
|
import ChatBot from "../Chatbot";
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
@@ -44,7 +45,7 @@ const StatusHeader = ({ monitor, connectionStatus }) => {
|
|||||||
>
|
>
|
||||||
<Typography
|
<Typography
|
||||||
variant="h1"
|
variant="h1"
|
||||||
color={theme.palette.distributedStatusHeader.primaryText}
|
color={theme.palette.distributedStatusHeader.textPrimary}
|
||||||
>
|
>
|
||||||
{MSG_MAP[connectionStatus]}
|
{MSG_MAP[connectionStatus]}
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -53,16 +54,16 @@ const StatusHeader = ({ monitor, connectionStatus }) => {
|
|||||||
borderRadius={theme.spacing(8)}
|
borderRadius={theme.spacing(8)}
|
||||||
padding={theme.spacing(4)}
|
padding={theme.spacing(4)}
|
||||||
backgroundColor={
|
backgroundColor={
|
||||||
theme.palette.distributedStatusHeader.primaryTextBackground
|
theme.palette.distributedStatusHeader.textPrimaryBackground
|
||||||
}
|
}
|
||||||
color={theme.palette.distributedStatusHeader.primaryText}
|
color={theme.palette.distributedStatusHeader.textPrimary}
|
||||||
>
|
>
|
||||||
Uptime: {(monitor.totalUptime * 100).toFixed(2)}%
|
Uptime: {(monitor.totalUptime * 100).toFixed(2)}%
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Typography
|
<Typography
|
||||||
variant="body2"
|
variant="body2"
|
||||||
color={theme.palette.distributedStatusHeader.secondaryText}
|
color={theme.palette.distributedStatusHeader.textSecondary}
|
||||||
>
|
>
|
||||||
Last updated{" "}
|
Last updated{" "}
|
||||||
<LastUpdate
|
<LastUpdate
|
||||||
@@ -72,6 +73,7 @@ const StatusHeader = ({ monitor, connectionStatus }) => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
<ChatBot sx={{ marginTop: theme.spacing(10) }} />
|
||||||
</ColContainer>
|
</ColContainer>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -276,19 +276,30 @@ const newSemanticColors = {
|
|||||||
light: newColors.red700,
|
light: newColors.red700,
|
||||||
dark: newColors.red700,
|
dark: newColors.red700,
|
||||||
},
|
},
|
||||||
primaryText: {
|
textPrimary: {
|
||||||
light: "#34D399",
|
light: "#34D399",
|
||||||
dark: "#34D399",
|
dark: "#34D399",
|
||||||
},
|
},
|
||||||
primaryTextBackground: {
|
textPrimaryBackground: {
|
||||||
light: "#094434",
|
light: "#094434",
|
||||||
dark: "#094434",
|
dark: "#094434",
|
||||||
},
|
},
|
||||||
secondaryText: {
|
textSecondary: {
|
||||||
light: "#22946C",
|
light: "#22946C",
|
||||||
dark: "#22946C",
|
dark: "#22946C",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
chatbot: {
|
||||||
|
background: {
|
||||||
|
light: "#112B2B",
|
||||||
|
dark: "#112B2B",
|
||||||
|
},
|
||||||
|
textAccent: {
|
||||||
|
light: "#C084FC",
|
||||||
|
dark: "#C084FC",
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export { typographyLevels, semanticColors as colors, newSemanticColors };
|
export { typographyLevels, semanticColors as colors, newSemanticColors };
|
||||||
Reference in new issue
Block a user