Timesheets open the modal with loader show the logs with loading

This commit is contained in:
JaiPandey425 2025-12-02 19:42:19 +05:30
parent 475776b214
commit 70193501d3
2 changed files with 5 additions and 1 deletions

View File

@ -95,3 +95,4 @@ const ProjectLogsModal: React.FC<Props> = ({ isOpen, onClose, projectName, logs,
};
export default ProjectLogsModal;

View File

@ -117,6 +117,7 @@ const Timesheets: React.FC = () => {
const handleViewLogs = async (projectID: string, projectName: string) => {
try {
setModalOpen(true);
setLoading(true);
setSelectedProject(projectID);
setSelectedProjectName(projectName);
@ -132,11 +133,13 @@ const Timesheets: React.FC = () => {
setLogs([]);
}
setModalOpen(true);
} catch (error) {
console.error("Error fetching logs:", error);
setModalOpen(false)
} finally {
setLoading(false);
}
};