first commit. working

This commit is contained in:
2025-06-26 13:09:12 -04:00
parent 86df5c354a
commit 45d8efdce6
14 changed files with 4185 additions and 255 deletions
+18
View File
@@ -0,0 +1,18 @@
"use client";
import React from 'react';
import { useAttendance } from '../hooks/useAttendance';
export default function ClockButton({ teacherId }: { teacherId: string }) {
const { todayRecords, clockToggle } = useAttendance();
const last = todayRecords.filter(r => r.teacherId === teacherId).pop();
const nextType = last?.type === 'in' ? 'out' : 'in';
return (
<button
onClick={() => clockToggle(teacherId)}
className="px-4 py-2 border rounded"
>
{nextType === 'in' ? 'Clock In' : 'Clock Out'}
</button>
);
}