From 7591de9d3dbdade9b7ba248f91d736a1ff9a4f62 Mon Sep 17 00:00:00 2001 From: Daniel Cojocea Date: Fri, 30 Aug 2024 13:22:12 -0400 Subject: [PATCH] Added docs --- Client/src/Utils/greeting.jsx | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) 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;