FPSMS-frontend
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

RoughScheduleDetailWrapper.tsx 928 B

1234567891011121314151617181920212223242526272829303132
  1. import { CreateItemInputs } from "@/app/api/settings/item/actions";
  2. import { fetchItem } from "@/app/api/settings/item";
  3. import GeneralLoading from "@/components/General/GeneralLoading";
  4. import RoughScheduleDetailView from "@/components/RoughScheduleDetail/RoughScheudleDetailView";
  5. import React from "react";
  6. import { ScheduleType, fetchRoughProdScheduleDetail } from "@/app/api/scheduling";
  7. interface SubComponents {
  8. Loading: typeof GeneralLoading;
  9. }
  10. type Props = {
  11. id?: number;
  12. type: ScheduleType;
  13. };
  14. const RoughScheduleDetailWrapper: React.FC<Props> & SubComponents = async ({
  15. id,
  16. type,
  17. }) => {
  18. const prodSchedule = id ? await fetchRoughProdScheduleDetail(id) : undefined;
  19. return (
  20. <RoughScheduleDetailView
  21. isEditMode={Boolean(id)}
  22. type={type}
  23. defaultValues={prodSchedule}
  24. />
  25. );
  26. };
  27. RoughScheduleDetailWrapper.Loading = GeneralLoading;
  28. export default RoughScheduleDetailWrapper;