import React from "react";
import CreateUser from "./CreateUser";
import CreateUserLoading from "./CreateUserLoading";
import { searchParamsProps } from "@/app/utils/fetchUtil";
import { fetchPwRules, fetchUser, fetchUserDetail } from "@/app/api/user";
import { fetchUserDetails } from "@/app/api/user/actions";
import { fetchAuth } from "@/app/api/group/actions";

interface SubComponents {
  Loading: typeof CreateUserLoading;
}

const CreateUserWrapper: React.FC & SubComponents = async ({}) => {
  const [pwRule, auths] = await Promise.all([
    fetchPwRules(),
    fetchAuth("user"),
  ]);

  return <CreateUser rules={pwRule} auths={auths.records} />;
};

CreateUserWrapper.Loading = CreateUserLoading;

export default CreateUserWrapper;
