import React from "react";
import QrCodeHandleEquipmentSearch from "./qrCodeHandleEquipmentSearch";
import EquipmentSearchLoading from "../EquipmentSearch/EquipmentSearchLoading";
import { fetchAllEquipments } from "@/app/api/settings/equipment";

interface SubComponents {
  Loading: typeof EquipmentSearchLoading;
}

const QrCodeHandleEquipmentSearchWrapper: React.FC & SubComponents = async () => {
  const equipments = await fetchAllEquipments();
  return <QrCodeHandleEquipmentSearch equipments={equipments} />;
};

QrCodeHandleEquipmentSearchWrapper.Loading = EquipmentSearchLoading;

export default QrCodeHandleEquipmentSearchWrapper;