import React from "react";
import QrCodeHandleSearch from "./qrCodeHandleSearch";
import QrCodeHandleSearchLoading from "./qrCodeHandleSearchLoading";
import { fetchUser } from "@/app/api/user";
import { fetchPrinterCombo } from "@/app/api/settings/printer";

interface SubComponents {
  Loading: typeof QrCodeHandleSearchLoading;
}

const QrCodeHandleSearchWrapper: React.FC & SubComponents = async () => {
  const [users, printerCombo] = await Promise.all([
    fetchUser(),
    fetchPrinterCombo(),
  ]);
  return <QrCodeHandleSearch users={users} printerCombo={printerCombo} />;
};

QrCodeHandleSearchWrapper.Loading = QrCodeHandleSearchLoading;

export default QrCodeHandleSearchWrapper;