// import { fetchPositionCategories, fetchPositions } from "@/app/api/companys";
import React from "react";
import PositionSearch from "./PositionSearch";
import PositionSearchLoading from "./PositionSearchLoading";
import { fetchPositions } from "@/app/api/positions";
import { fetchUserAbilities } from "@/app/utils/fetchUtil";

interface SubComponents {
  Loading: typeof PositionSearchLoading;
}

const PositionSearchWrapper: React.FC & SubComponents = async () => {
  const [Positions, abilities] = await Promise.all([fetchPositions(), fetchUserAbilities()]);
  // const Positions:any[] = []

  return <PositionSearch positions={Positions} abilities={abilities}/>;
};

PositionSearchWrapper.Loading = PositionSearchLoading;

export default PositionSearchWrapper;
