import { preloadClaims } from "@/app/api/claims";
import { preloadStaff, preloadTeamLeads } from "@/app/api/staff";
import ChangePassword from "@/components/ChangePassword";
import StaffSearch from "@/components/StaffSearch";
import TeamSearch from "@/components/TeamSearch";
import UserGroupSearch from "@/components/UserGroupSearch";
import UserSearch from "@/components/UserSearch";
import { I18nProvider, 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: "Change Password",
};

const ChangePasswordPage: React.FC = async () => {
  const { t } = await getServerI18n("changePassword");
  // preloadTeamLeads();
  // preloadStaff();
  return (
    <>
      <Stack
        direction="row"
        justifyContent="space-between"
        flexWrap="wrap"
        rowGap={2}
      >
        <Typography variant="h4" marginInlineEnd={2}>
          {t("Change Password")}
        </Typography>
      </Stack>
      <I18nProvider namespaces={["common", "changePassword"]}>
        <Suspense fallback={<ChangePassword.Loading />}>
          <ChangePassword />
        </Suspense>
      </I18nProvider>
    </>
  );
};

export default ChangePasswordPage;
