import React from "react";
import QcCategorySearchLoading from "./QcCategorySearchLoading";
import QcCategorySearch from "./QcCategorySearch";
import { fetchQcCategories } from "@/app/api/settings/qcCategory";

interface SubComponents {
  Loading: typeof QcCategorySearchLoading;
}

const QcCategorySearchWrapper: React.FC & SubComponents = async () => {
  const [qcCategories] = await Promise.all([fetchQcCategories()]);

  return <QcCategorySearch qcCategories={qcCategories} />;
};

QcCategorySearchWrapper.Loading = QcCategorySearchLoading;

export default QcCategorySearchWrapper;
