diff --git a/Client/src/Components/Check/Check.jsx b/Client/src/Components/Check/Check.jsx index 501d0a344..1b246566f 100644 --- a/Client/src/Components/Check/Check.jsx +++ b/Client/src/Components/Check/Check.jsx @@ -1,6 +1,7 @@ import "./check.css"; import PropTypes from "prop-types"; import CheckGrey from "../../assets/icons/check.svg?react"; +import CheckOutlined from "../../assets/icons/check-outlined.svg?react"; import { Stack, Typography } from "@mui/material"; import { useTheme } from "@emotion/react"; @@ -11,6 +12,7 @@ import { useTheme } from "@emotion/react"; * @param {Object} props - The properties that define the `Check` component. * @param {string} props.text - The text to be displayed as the label next to the check icon. * @param {'info' | 'error' | 'success'} [props.variant='info'] - The variant of the check component, affecting its styling. + * @param {boolean} [props.outlined] - Whether the check icon should be outlined or not. * * @example * // To use this component, import it and use it in your JSX like this: @@ -18,12 +20,12 @@ import { useTheme } from "@emotion/react"; * * @returns {React.Element} The `Check` component with a check icon and a label, defined by the `text` prop. */ -const Check = ({ text, variant = "info" }) => { +const Check = ({ text, variant = "info", outlined = false }) => { const theme = useTheme(); return ( { }`} alignItems="center" > - + {outlined ? ( + + ) : ( + + )} {text} ); @@ -42,6 +48,7 @@ const Check = ({ text, variant = "info" }) => { Check.propTypes = { text: PropTypes.string.isRequired, variant: PropTypes.oneOf(["info", "error", "success"]), + outlined: PropTypes.bool, }; export default Check; diff --git a/Client/src/Components/Fallback/index.css b/Client/src/Components/Fallback/index.css new file mode 100644 index 000000000..226c7bc47 --- /dev/null +++ b/Client/src/Components/Fallback/index.css @@ -0,0 +1,28 @@ +[class*="fallback__"] { + width: fit-content; + margin: auto; + margin-top: 100px; +} +[class*="fallback__"] h1.MuiTypography-root { + font-size: var(--env-var-font-size-large); + font-weight: 600; +} +[class*="fallback__"] .check span.MuiTypography-root, +[class*="fallback__"] h1.MuiTypography-root { + color: var(--env-var-color-5); +} +[class*="fallback__"] button.MuiButtonBase-root, +[class*="fallback__"] .check { + width: max-content; +} +[class*="fallback__"] button.MuiButtonBase-root { + height: 34px; +} +[class*="fallback__"] .check span.MuiTypography-root, +[class*="fallback__"] button.MuiButtonBase-root { + font-size: var(--env-var-font-size-medium); +} + +.fallback__status > .MuiStack-root { + margin-left: var(--env-var-spacing-2); +} diff --git a/Client/src/Components/Fallback/index.jsx b/Client/src/Components/Fallback/index.jsx new file mode 100644 index 000000000..943c3aa5e --- /dev/null +++ b/Client/src/Components/Fallback/index.jsx @@ -0,0 +1,60 @@ +import PropTypes from "prop-types"; +import { useTheme } from "@emotion/react"; +import { Stack, Typography } from "@mui/material"; +import Skeleton from "../../assets/Images/create-placeholder.svg?react"; +import Button from "../Button"; +import Check from "../Check/Check"; +import { useNavigate } from "react-router-dom"; +import "./index.css"; + +/** + * Fallback component to display a fallback UI with a title, a list of checks, and a navigation button. + * + * @param {Object} props - The component props. + * @param {string} props.title - The title to be displayed in the fallback UI. + * @param {Array} props.checks - An array of strings representing the checks to display. + * @param {string} [props.link="/"] - The link to navigate to. + * + * @returns {JSX.Element} The rendered fallback UI. + */ + +const Fallback = ({ title, checks, link = "/" }) => { + const theme = useTheme(); + const navigate = useNavigate(); + + return ( + + + + + A {title} is used to: + + {checks.map((check, index) => ( + + ))} + + +
+
); }; diff --git a/Client/src/Pages/Status/index.jsx b/Client/src/Pages/Status/index.jsx index f0cf82b60..071948576 100644 --- a/Client/src/Pages/Status/index.jsx +++ b/Client/src/Pages/Status/index.jsx @@ -1,7 +1,26 @@ -import React from "react"; +import Fallback from "../../Components/Fallback"; +import { useTheme } from "@emotion/react"; const Status = () => { - return
Status
; + const theme = useTheme(); + + return ( +
+ +
+ ); }; export default Status; diff --git a/Client/src/assets/Images/create-placeholder.svg b/Client/src/assets/Images/create-placeholder.svg new file mode 100644 index 000000000..bdd9ef945 --- /dev/null +++ b/Client/src/assets/Images/create-placeholder.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Client/src/assets/icons/check-outlined.svg b/Client/src/assets/icons/check-outlined.svg new file mode 100644 index 000000000..d26657863 --- /dev/null +++ b/Client/src/assets/icons/check-outlined.svg @@ -0,0 +1,3 @@ + + +