import React from "react";
import GeneralLoading from "../General/GeneralLoading";
import { fetchInventories } from "@/app/api/inventory";
import InventorySearch from "./InventorySearch";

interface SubComponents {
  Loading: typeof GeneralLoading;
}

const InventorySearchWrapper: React.FC & SubComponents = async () => {
  const [inventories] = await Promise.all([fetchInventories()]);

  return <InventorySearch inventories={inventories} />;
};

InventorySearchWrapper.Loading = GeneralLoading;

export default InventorySearchWrapper;
