FPSMS-frontend
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

46 lines
1.2 KiB

  1. import { Metadata } from "next";
  2. import { getServerI18n, I18nProvider } from "@/i18n";
  3. import Typography from "@mui/material/Typography";
  4. import { Suspense } from "react";
  5. import { Stack } from "@mui/material";
  6. import { Button } from "@mui/material";
  7. import Link from "next/link";
  8. import UserSearch from "@/components/UserSearch";
  9. import Add from "@mui/icons-material/Add";
  10. export const metadata: Metadata = {
  11. title: "User Management",
  12. };
  13. const User: React.FC = async () => {
  14. const { t } = await getServerI18n("user");
  15. return (
  16. <>
  17. <Stack
  18. direction="row"
  19. justifyContent="space-between"
  20. flexWrap="wrap"
  21. rowGap={2}
  22. >
  23. <Typography variant="h4" marginInlineEnd={2}>
  24. {t("User")}
  25. </Typography>
  26. <Button
  27. variant="contained"
  28. startIcon={<Add />}
  29. LinkComponent={Link}
  30. href="/settings/user/create"
  31. >
  32. {t("Create User")}
  33. </Button>
  34. </Stack>
  35. <I18nProvider namespaces={["user", "common"]}>
  36. <Suspense fallback={<UserSearch.Loading />}>
  37. <UserSearch />
  38. </Suspense>
  39. </I18nProvider>
  40. </>
  41. );
  42. };
  43. export default User;