diff --git a/src/components/Activities/AttendcesLogs.jsx b/src/components/Activities/AttendcesLogs.jsx index feda6c77..1ac58c72 100644 --- a/src/components/Activities/AttendcesLogs.jsx +++ b/src/components/Activities/AttendcesLogs.jsx @@ -112,7 +112,7 @@ const AttendanceLog = ({ handleModalData, projectId, showOnlyCheckout }) => { const { currentPage, totalPages, currentItems: paginatedAttendances, paginate, resetPage } = usePagination( processedData, - 10 + 20 ); // Reset to the first page whenever processedData changes (due to switch on/off) diff --git a/src/components/Activities/ReportTaskComments.jsx b/src/components/Activities/ReportTaskComments.jsx index efe62d0a..91399b79 100644 --- a/src/components/Activities/ReportTaskComments.jsx +++ b/src/components/Activities/ReportTaskComments.jsx @@ -13,6 +13,15 @@ const schema = z.object({ comment: z.string().min(1, "Comment cannot be empty"), }); +/** + * ReportTaskComments component for displaying and adding comments to a task. + * It also shows a summary of the activity and task details. + * + * @param {object} props - The component props. + * @param {object} props.commentsData - Data related to the task and its comments, including the description. + * @param {function} props.closeModal - Callback function to close the modal. + */ + const ReportTaskComments = ({ commentsData, closeModal }) => { const [loading, setloading] = useState(false); const [comments, setComment] = useState([]); @@ -27,7 +36,7 @@ const ReportTaskComments = ({ commentsData, closeModal }) => { }); const containerRef = useRef(null); - const firstRender = useRef(true); + const firstRender = useRef(true); useEffect(() => { @@ -79,7 +88,7 @@ const ReportTaskComments = ({ commentsData, closeModal }) => { showToast(error.response.data?.message || "Something went wrong", "error"); } }; - + console.log("Kartik", commentsData) return (
{ onClick={closeModal} aria-label="Close" > -

Activity Summary

+
+ Activity Summary +
+ +

- {comments && comments[0]?.comment} + {commentsData?.workItem?.workArea?.floor?.building?.description}

+

Assigned By : @@ -126,7 +140,7 @@ const ReportTaskComments = ({ commentsData, closeModal }) => { Completed Work : {commentsData?.completedTask}

-

Team:

+

Team :

{commentsData?.teamMembers?.map((member, idx) => ( @@ -147,7 +161,7 @@ const ReportTaskComments = ({ commentsData, closeModal }) => { {...register("comment")} className="form-control" id="exampleFormControlTextarea1" - rows="1" + // rows="2" placeholder="Enter comment" /> {errors.comment && ( @@ -170,8 +184,8 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
    {comments && comments @@ -196,9 +210,9 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
-
-

{fullName}

-

+

+

{fullName}

+

{moment.utc(data?.commentDate).local().fromNow()}