import { ConsultationForm } from "@/components/forms";
import { getSettings } from "@/lib/data";
import { db } from "@/db";
import { settings } from "@/db/schema";
import { eq } from "drizzle-orm";
export const metadata = { title: "Book a Teleconsultation" };
export default async function P() {
  await getSettings();
  const [cfg] = await db.select().from(settings).where(eq(settings.key, "consultation"));
  const v = (cfg?.value as { types?: string[]; times?: string[] }) || {};
  const types = v.types?.length ? v.types : ["General Health Consultation", "Medication Review", "Mother & Baby Advice", "Chronic Condition Follow-up"];
  const times = v.times?.length ? v.times : ["09:00", "10:00", "11:00", "12:00", "14:00", "15:00", "16:00", "17:00"];
  return <div className="container-x py-12 grid lg:grid-cols-2 gap-10 items-start"><div><span className="text-brand font-bold text-sm">MY FAMILY TELECONSULTATION</span><h1 className="text-3xl font-extrabold mt-2">Professional care, closer to you</h1><p className="text-slate-600 mt-3">Request a remote consultation. Our team will confirm your booking by phone. Services are delivered only by appropriately authorised professionals. For emergencies, visit the nearest health facility.</p>
  {/* eslint-disable-next-line @next/next/no-img-element */}
  <img src="https://images.pexels.com/photos/8376207/pexels-photo-8376207.jpeg?auto=compress&cs=tinysrgb&w=900" alt="Teleconsultation" className="rounded-3xl mt-6 aspect-video object-cover w-full" /></div><div className="card p-7"><ConsultationForm types={types} times={times} /></div></div>;
}
