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.
 
 

25 lines
614 B

  1. import React from "react";
  2. import QcItemSaveLoading from "./QcItemSaveLoading";
  3. import QcItemSave from "./QcItemSave";
  4. import { fetchQcItemDetails } from "@/app/api/settings/qcItem";
  5. interface SubComponents {
  6. Loading: typeof QcItemSaveLoading;
  7. }
  8. type SaveQcItemProps = {
  9. id?: string;
  10. };
  11. type Props = SaveQcItemProps;
  12. const QcItemSaveWrapper: React.FC<Props> & SubComponents = async (props) => {
  13. const qcItem = props.id ? await fetchQcItemDetails(props.id) : undefined;
  14. return <QcItemSave defaultInputs={qcItem} />;
  15. };
  16. QcItemSaveWrapper.Loading = QcItemSaveLoading;
  17. export default QcItemSaveWrapper;