diff --git a/Client/src/Utils/greeting.jsx b/Client/src/Utils/greeting.jsx index e184d1d60..03a66da24 100644 --- a/Client/src/Utils/greeting.jsx +++ b/Client/src/Utils/greeting.jsx @@ -1,9 +1,22 @@ +import PropTypes from "prop-types"; import { useTheme } from "@emotion/react"; import { Box, Typography } from "@mui/material"; -import React from "react"; import { useSelector } from "react-redux"; -const Greeting = ({ type }) => { +/** + * Greeting component that displays a personalized greeting message + * based on the time of day and the user's first name. + * + * @component + * @example + * return ; + * + * @param {Object} props + * @param {string} props.type - The type of monitor to be displayed in the message + * @returns {JSX.Element} The rendered Greeting component + */ + +const Greeting = ({ type = "" }) => { const theme = useTheme(); const { firstName } = useSelector((state) => state.auth.user); @@ -55,4 +68,8 @@ const Greeting = ({ type }) => { ); }; +Greeting.propTypes = { + type: PropTypes.string, +}; + export default Greeting;