import React from "react";
import UserGroupSearchLoading from "./UserGroupSearchLoading";
import { fetchGroup } from "@/app/api/group";
import UserGroupSearch from "./UserGroupSearch";

interface SubComponents {
  Loading: typeof UserGroupSearchLoading;
}

const UserGroupSearchWrapper: React.FC & SubComponents = async () => {
const group = await fetchGroup()

  return <UserGroupSearch groups={group.records} />;
};

UserGroupSearchWrapper.Loading = UserGroupSearchLoading;

export default UserGroupSearchWrapper;
