25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

42 satır
1.1 KiB

  1. import {
  2. RecordLeaveInput,
  3. RecordTimesheetInput,
  4. } from "@/app/api/timesheets/actions";
  5. import React from "react";
  6. import { useFormContext } from "react-hook-form";
  7. import EntryInputTable from "./EntryInputTable";
  8. import { AssignedProject, ProjectWithTasks } from "@/app/api/projects";
  9. import DateHoursTable from "../DateHoursTable";
  10. import { HolidaysResult } from "@/app/api/holidays";
  11. interface Props {
  12. allProjects: ProjectWithTasks[];
  13. assignedProjects: AssignedProject[];
  14. leaveRecords: RecordLeaveInput;
  15. companyHolidays: HolidaysResult[];
  16. }
  17. const TimesheetTable: React.FC<Props> = ({
  18. allProjects,
  19. assignedProjects,
  20. leaveRecords,
  21. companyHolidays,
  22. }) => {
  23. const { watch } = useFormContext<RecordTimesheetInput>();
  24. const currentInput = watch();
  25. const days = Object.keys(currentInput);
  26. return (
  27. <DateHoursTable
  28. companyHolidays={companyHolidays}
  29. days={days}
  30. leaveEntries={leaveRecords}
  31. timesheetEntries={currentInput}
  32. EntryTableComponent={EntryInputTable}
  33. entryTableProps={{ assignedProjects, allProjects }}
  34. />
  35. );
  36. };
  37. export default TimesheetTable;