import { db } from "@/src/db";
import LocationSelector from "../../components/LocationSelector";
import LocationContextProvider from "@/components/locationContext";
import GroupCreator from "./GroupCreator";

export default async function Page() {
  let provinces = await db.query.province
    .findMany({ with: { zones: true } })
    .execute();
  let jobList = await db.query.group.findMany().execute();
  return (
    <LocationContextProvider>
      <LocationSelector provinces={provinces} />
      <GroupCreator allJobs={jobList} />
    </LocationContextProvider>
  );
}
