From 2aac260556de92dee70e70471fe7b847b73e9369 Mon Sep 17 00:00:00 2001 From: Daniel Cojocea Date: Wed, 26 Jun 2024 19:12:50 -0400 Subject: [PATCH] Added proptypes and jsdocs --- Client/src/Components/ProgressBars/index.jsx | 24 ++++++++++++------- .../src/Components/TextFields/Image/index.jsx | 11 +++++++++ 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/Client/src/Components/ProgressBars/index.jsx b/Client/src/Components/ProgressBars/index.jsx index 3bcd31b16..211777080 100644 --- a/Client/src/Components/ProgressBars/index.jsx +++ b/Client/src/Components/ProgressBars/index.jsx @@ -1,5 +1,6 @@ -import React, { useState } from "react"; +import React from "react"; import { useTheme } from "@emotion/react"; +import PropTypes from "prop-types"; import { Box, IconButton, @@ -12,16 +13,15 @@ import "./index.css"; /** * @param {Object} props - The component props. + * @param {JSX.Element} props.icon - The icon element to display (optional). + * @param {string} props.label - The label text for the progress item. + * @param {string} props.size - The size information for the progress item. + * @param {number} props.progress - The current progress value (0-100). + * @param {function} props.onClick - The function to handle click events on the remove button. * @returns {JSX.Element} The rendered component. */ -const ProgressUpload = ({ - icon, - label, - size, - progress = 0, - onClick, -}) => { +const ProgressUpload = ({ icon, label, size, progress = 0, onClick }) => { const theme = useTheme(); return ( { const theme = useTheme(); @@ -112,4 +117,10 @@ const ImageField = ({ id, picture, onChange }) => { ); }; +ImageField.propTypes = { + id: PropTypes.string.isRequired, + picture: PropTypes.string, + onChange: PropTypes.func.isRequired, +}; + export default ImageField;