Timesheets open the modal with loader show the logs with loading
This commit is contained in:
parent
475776b214
commit
70193501d3
|
|
@ -95,3 +95,4 @@ const ProjectLogsModal: React.FC<Props> = ({ isOpen, onClose, projectName, logs,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ProjectLogsModal;
|
export default ProjectLogsModal;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,7 @@ const Timesheets: React.FC = () => {
|
||||||
|
|
||||||
const handleViewLogs = async (projectID: string, projectName: string) => {
|
const handleViewLogs = async (projectID: string, projectName: string) => {
|
||||||
try {
|
try {
|
||||||
|
setModalOpen(true);
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
setSelectedProject(projectID);
|
setSelectedProject(projectID);
|
||||||
setSelectedProjectName(projectName);
|
setSelectedProjectName(projectName);
|
||||||
|
|
@ -132,11 +133,13 @@ const Timesheets: React.FC = () => {
|
||||||
setLogs([]);
|
setLogs([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
setModalOpen(true);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error fetching logs:", error);
|
console.error("Error fetching logs:", error);
|
||||||
|
setModalOpen(false)
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue