The code returns the following error:
Cannot read properties of undefined (reading 'accepted')
at EmployeeViewDocumentModal (/components/employee/modals/employee-view-document-modal)
Revise the code to address the error.
I was previewing: /employee
Now let me check the employee-sent-documents component to see how it's passing the document prop:
I found the issue. The employee-sent-documents.tsx is passing documentTitle as a prop but the EmployeeViewDocumentModal expects a full document object. Let me fix this:
I've fixed the error by updating the employee-sent-documents.tsx component to pass the correct props to EmployeeViewDocumentModal. The component was passing only documentTitle but the modal expected a full document object with properties like accepted, sentBy, etc. Now it properly constructs the document object with all required fields, including mapping the sentTo field to sentBy, and passing the handleMarkReceived function as the onAccept handler.
instead of sent to employee the sms and email add another button beside of create document, the button is label "Sent sms & Email"
Now I'll create a standalone SMS & Email modal and add the button to the document list:
Now I'll add the button to the document list and integrate the modal:
I've successfully created a standalone SMS & Email sending feature. The new "Send SMS & Email" button is now positioned beside the "Create Document" button in the document list header. When clicked, it opens a dedicated modal that allows HR to select employees using the same filtering system (department, unit, position, and job level), choose between SMS, Email, or both notification methods, and select or customize message templates before sending.
add a contact number.
For Template can edit also.