{/* Header */}
{/* Navigation */}
{/* Create Timesheet View */}
{currentView === ‘create’ && (
)}
)}
{/* History View */}
{currentView === ‘history’ && (
) : (
)}
Timesheet Management
Track, submit and manage your timesheets
New Timesheet
setCurrentTimesheet({ …currentTimesheet, weekEnding: e.target.value })}
className=”w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent”
/>
setCurrentTimesheet({ …currentTimesheet, clientName: e.target.value })}
placeholder=”Enter client name”
className=”w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent”
/>
setCurrentTimesheet({ …currentTimesheet, projectName: e.target.value })}
placeholder=”Enter project name”
className=”w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent”
/>
Time Entries
{currentTimesheet.entries.map((entry, index) => (
))}
{currentTimesheet.entries.length > 0 && (
updateEntry(index, ‘date’, e.target.value)}
className=”w-full px-3 py-2 text-sm border border-gray-300 rounded focus:ring-2 focus:ring-blue-500″
/>
updateEntry(index, ‘startTime’, e.target.value)}
className=”w-full px-3 py-2 text-sm border border-gray-300 rounded focus:ring-2 focus:ring-blue-500″
/>
updateEntry(index, ‘endTime’, e.target.value)}
className=”w-full px-3 py-2 text-sm border border-gray-300 rounded focus:ring-2 focus:ring-blue-500″
/>
updateEntry(index, ‘breakMinutes’, parseInt(e.target.value) || 0)}
className=”w-full px-3 py-2 text-sm border border-gray-300 rounded focus:ring-2 focus:ring-blue-500″
/>
updateEntry(index, ‘description’, e.target.value)}
placeholder=”Work description…”
className=”w-full px-3 py-2 text-sm border border-gray-300 rounded focus:ring-2 focus:ring-blue-500″
/>
Total Hours:
{getTotalHours()}
Timesheet History
{timesheets.length === 0 ? (No timesheets yet
Create your first timesheet to get started
{timesheets.map((timesheet) => (
{timesheet.approvalDate && (
)}
{timesheet.comments && (
)}
))}
)}
{timesheet.clientName}
{timesheet.projectName && ({timesheet.projectName}
)}Week Ending: {new Date(timesheet.weekEnding).toLocaleDateString()}
Total Hours
{timesheet.totalHours}
Entries
{timesheet.entries.length}
Submitted
{new Date(timesheet.submittedDate).toLocaleDateString()}
Processed
{new Date(timesheet.approvalDate).toLocaleDateString()}
Comments:
{timesheet.comments}
{timesheet.status === ‘pending’ && (
<>
>
)}