import DoWorkbenchTabs from "@/components/DoWorkbench/DoWorkbenchTabs";
import PageTitleBar from "@/components/PageTitleBar";
import { getServerI18n, I18nProvider } from "@/i18n";
import { Metadata } from "next";
import { fetchPrinterCombo } from "@/app/api/settings/printer";

export const metadata: Metadata = {
  title: "DO Workbench",
};

const DoWorkbenchPage: React.FC = async () => {
  const { t } = await getServerI18n("do");
  const printerCombo = await fetchPrinterCombo();

  return (
    <>
      <PageTitleBar title={t("DO Workbench", { defaultValue: "DO Workbench" })} className="mb-4" />
      <I18nProvider namespaces={["pickOrder", "common", "ticketReleaseTable", "do"]}>
        <DoWorkbenchTabs printerCombo={printerCombo ?? []} />
      </I18nProvider>
    </>
  );
};

export default DoWorkbenchPage;
