Add activity column to logs for clearer action tracking
This commit is contained in:
parent
4f1cf7c0a5
commit
c53aa1ec92
@ -7,6 +7,30 @@ const AttendLogs = ({ Id }) => {
|
||||
|
||||
const {logs, loading} = useEmployeeAttendacesLog( Id )
|
||||
|
||||
const whichActivityPerform = ( actvity ) =>
|
||||
{
|
||||
switch (actvity) {
|
||||
case 1:
|
||||
return "IN"
|
||||
break;
|
||||
case 2:
|
||||
return "Requested"
|
||||
break;
|
||||
case 3:
|
||||
return "Deleted"
|
||||
break;
|
||||
case 4:
|
||||
return "OUT"
|
||||
break;
|
||||
case 5:
|
||||
return "Regularized"
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="table-responsive">
|
||||
{loading && <p>Loading..</p>}
|
||||
@ -21,9 +45,10 @@ const AttendLogs = ({ Id }) => {
|
||||
<table className="table table-sm mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style={{ width: '20%' }}>Time</th>
|
||||
<th style={{width: '15%'}}>Time</th>
|
||||
<th style={{ width: '20%' }}>Activity</th>
|
||||
<th style={{ width: '20%' }}>Date</th>
|
||||
<th style={{ width: '60%' }}>Description</th>
|
||||
<th style={{ width: '45%' }}>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -32,7 +57,8 @@ const AttendLogs = ({ Id }) => {
|
||||
.sort((a, b) => b.id - a.id)
|
||||
.map((log, index) => (
|
||||
<tr key={index}>
|
||||
<td>{convertShortTime(log.activityTime)}</td>
|
||||
<td>{convertShortTime( log.activityTime )}</td>
|
||||
<td>{whichActivityPerform(log.activity)}</td>
|
||||
<td>{log.activityTime.slice(0, 10)}</td>
|
||||
<td className="text-wrap" colSpan={3}>
|
||||
{log?.comment}
|
||||
|
Loading…
x
Reference in New Issue
Block a user