FPSMS-frontend
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

26 line
555 B

  1. import React from "react";
  2. import GeneralLoading from "../General/GeneralLoading";
  3. import { fetchJoDetail } from "@/app/api/jo";
  4. import JoSave from "./JoSave";
  5. interface SubComponents {
  6. Loading: typeof GeneralLoading;
  7. }
  8. type JoSaveProps = {
  9. id?: number;
  10. }
  11. type Props = JoSaveProps
  12. const JoSaveWrapper: React.FC<Props> & SubComponents = async ({
  13. id,
  14. }) => {
  15. const jo = id ? await fetchJoDetail(id) : undefined
  16. return <JoSave id={id} defaultValues={jo}/>
  17. }
  18. JoSaveWrapper.Loading = GeneralLoading;
  19. export default JoSaveWrapper;