"use client";
import CreatePatientForm from "@/components/forms/patients/new/CreatePatientForm";
import SectionTitle from "@/components/SectionTitle";
import {useGetAllCountries} from "@/hooks/country";
import Link from "next/link";
import {useRouter} from "next/navigation";
import React from "react";

export default function Page() {
  const router = useRouter();
  const {data, isLoading} = useGetAllCountries();

  return (
    <div>
      <div className="flex items-center justify-between mb-10">
        <SectionTitle label="فرم افزودن بیمار جدید" />
        <Link
          href={`/patients`}
          className="text-sm bg-primary px-4 py-2 rounded-lg text-white"
        >
          مشاهده لیست بیماران
        </Link>
      </div>
      
      <CreatePatientForm
        router={router}
        countries={data?.data}
        fetchCountriesLoading={isLoading}
      />
    </div>
  );
}
