setSearchQuery(e.target.value)}
className="flex-1 h-8 text-xs"
/>
({ value: index.toString(), label: month }))}
triggerClassName="h-8 px-2 py-1 text-xs"
/>
({ value: year.toString(), label: year.toString() }))}
triggerClassName="h-8 px-2 py-1 text-xs"
/>
{showEmployeeFilter && (
({
value: employee.id.toString(),
label: `${employee.firstName} ${employee.lastName}`,
})),
]}
triggerClassName="h-8 px-2 py-1 text-xs"
/>
)}
{!isMobile && (
{isAttendanceAdmin && (
)}
)}
{isLoading ? (
Loading attendance data...
) : (!isMobile && viewMode === 'matrix' && isAttendanceAdmin) ? (
{employeesLoading ? (
) : !employees || employees.length === 0 ? (
) : (
<>
Present
Absent
Half Day
Leave
|
Employee
|
{matrixDays.map(day => (
{day}
|
))}
{matrixEmployees.map(emp => (
|
{emp.firstName} {emp.lastName}
|
{matrixDays.map(day => {
const record = recordByEmployeeDay.get(`${emp.id}-${day}`);
const cellRecord = record && (statusFilter === "all" || record.status === statusFilter) ? record : null;
const title = cellRecord
? `${cellRecord.status}${cellRecord.inTime ? ` | In: ${cellRecord.inTime}` : ""}${cellRecord.outTime ? ` | Out: ${cellRecord.outTime}` : ""} | Total: ${getOfficeDurationLabel(cellRecord.inTime, cellRecord.outTime)}`
: "";
return (
{cellRecord ? (
) : (
ยท
)}
|
);
})}
))}
>
)}
) : filteredAttendance.length > 0 ? (
<>
{(isMobile || viewMode === 'cards') && (
{filteredAttendance.map((record, index) => (
))}
)}
{!isMobile && viewMode === 'table' && (
Employee
Date
In Time
Out Time
Total Time
Status
Comments
{filteredAttendance.map((record, index) => (
{getEmployeeName(record.employeeId)}
{format(parseAttendanceDate(record.date), "dd MMM yyyy")}
{record.inTime ? (
{formatTime(record.inTime)}
) : (
Not recorded
)}
{record.outTime ? (
{formatTime(record.outTime)}
) : (
Not recorded
)}
{getOfficeDurationLabel(record.inTime, record.outTime)}
{getStatusBadge(record.status)}
{record.comments || "-"}
))}
)}
>
) : (
No attendance records found
Try changing filters or importing attendance data
)}
{viewMode !== 'matrix' && filteredAttendance.length > 0 && (
{filteredAttendance.length} records found
)}