Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

35 řádky
1.1 KiB

  1. import { fetchStaff, fetchTeamLeads } from "@/app/api/staff";
  2. import React from "react";
  3. import StaffSearch from "./StaffSearch";
  4. import StaffSearchLoading from "./StaffSearchLoading";
  5. import { Session, getServerSession } from "next-auth";
  6. import { authOptions } from "@/config/authConfig";
  7. import { fetchTeam } from "@/app/api/team";
  8. import { fetchPositions } from "@/app/api/positions";
  9. import { fetchGrades } from "@/app/api/grades";
  10. import { MAINTAIN_USER } from "@/middleware";
  11. interface SubComponents {
  12. Loading: typeof StaffSearchLoading;
  13. }
  14. interface SessionWithAbilities extends Session {
  15. abilities?: string[]
  16. }
  17. const StaffSearchWrapper: React.FC & SubComponents = async () => {
  18. const session = await getServerSession(authOptions) as SessionWithAbilities;
  19. const abilities = session.abilities!
  20. const staff = await fetchStaff();
  21. const teams = await fetchTeam();
  22. const grades = await fetchGrades();
  23. const positions = await fetchPositions();
  24. return <StaffSearch staff={staff} teams={teams} grades={grades} positions={positions} abilities={abilities}/>;
  25. };
  26. StaffSearchWrapper.Loading = StaffSearchLoading;
  27. export default StaffSearchWrapper;