import React from "react";
import CreateGroupLoading from "./CreateGroupLoading";
import { fetchStaff, fetchTeamLeads } from "@/app/api/staff";
import { useSearchParams } from "next/navigation";
import CreateGroup from "./CreateGroup";
import { auth, fetchAuth } from "@/app/api/group/actions";
import { fetchUser } from "@/app/api/user";

interface SubComponents {
  Loading: typeof CreateGroupLoading;
} 

const CreateGroupWrapper: React.FC & SubComponents = async () => {
    const records = await fetchAuth("group")
    const users = await fetchUser()
    console.log(users)
    const auth = records.records as auth[]

  return <CreateGroup auth={auth} users={users}/>;
};

CreateGroupWrapper.Loading = CreateGroupLoading;

export default CreateGroupWrapper;
