import { preloadClaims } from "@/app/api/claims";
import ClaimSearch from "@/components/ClaimSearch";
import PoSearch from "@/components/PoSearch";
import { getServerI18n } from "@/i18n";
import Add from "@mui/icons-material/Add";
import Button from "@mui/material/Button";
import Stack from "@mui/material/Stack";
import Typography from "@mui/material/Typography";
import { Metadata } from "next";
import Link from "next/link";
import { Suspense } from "react";

export const metadata: Metadata = {
  title: "Purchase Order",
};

const PurchaseOrder: React.FC = async () => {
  const { t } = await getServerI18n("purchaseOrder");
//   preloadClaims();

  return (
    <>
      <Stack
        direction="row"
        justifyContent="space-between"
        flexWrap="wrap"
        rowGap={2}
      >
        {/* <Button
          variant="contained"
          startIcon={<Add />}
          LinkComponent={Link}
          href="/po/create"
        >
          {t("Create Po")}
        </Button> */}
      </Stack>
      <Suspense fallback={<PoSearch.Loading />}>
        <PoSearch />
      </Suspense>
    </>
  );
};

export default PurchaseOrder;
