import { Canvas, useFrame } from "@react-three/fiber"; import { createFileRoute } from "@tanstack/react-router"; import { ArrowDown, ArrowRight, ArrowUpRight, BadgeCheck, CalendarDays, Check, Clock3, Heart, MapPin, Menu, MessageCircle, Phone, ShieldCheck, Sparkles, Star, X, } from "lucide-react"; import { useEffect, useRef, useState, type CSSProperties, type FormEvent, type ReactNode } from "react"; import { Group, LatheGeometry, Vector2 } from "three"; import type { ThreeEvent } from "@react-three/fiber"; import { z } from "zod"; import clinicLogo from "@/assets/apex-clinic-logo-crop.jpg.asset.json"; import clinicInterior from "@/assets/apex-clinic-interior.jpg.asset.json"; import clinicLounge from "@/assets/apex-clinic-lounge.jpg.asset.json"; import { Button } from "@/components/ui/button"; import { getAbujaOpeningStatus, getAvailableAppointmentSlots } from "@/lib/clinic-hours"; const WHATSAPP_URL = "https://wa.me/2348173555551?text=Hello%20Apex%20Dental%20Services,%20I%20would%20like%20to%20book%20a%20consultation"; const MAP_URL = "https://www.google.com/maps/search/?api=1&query=Suite+214+Jinifa+Plaza+Wuse+Abuja+Nigeria"; const services = [ { number: "01", title: "Porcelain veneers", detail: "Thoughtfully crafted veneers and complete smile makeovers, tailored to you.", icon: Sparkles, tag: "SMILE DESIGN", }, { number: "02", title: "Clear aligners", detail: "A discreet, modern approach to orthodontic care for every stage of life.", icon: Heart, tag: "ORTHODONTICS", }, { number: "03", title: "Laser whitening", detail: "In-clinic whitening and take-home options for a brighter smile.", icon: Sparkles, tag: "COSMETIC CARE", }, { number: "04", title: "Dental implants", detail: "Restorative implant care and bone grafting, planned around your needs.", icon: ShieldCheck, tag: "RESTORATIVE", }, { number: "05", title: "Gentle dental care", detail: "Root canal therapy, scaling and polishing, with your comfort in mind.", icon: BadgeCheck, tag: "GENERAL DENTISTRY", }, { number: "06", title: "Family dentistry", detail: "Welcoming preventive and pediatric dental care for the whole family.", icon: Heart, tag: "ALL AGES", }, ]; const bookingSchema = z.object({ name: z.string().trim().min(2, "Please enter your full name.").max(100, "Please use a shorter name."), phone: z .string() .trim() .min(7, "Enter a valid WhatsApp or phone number.") .max(22, "Enter a valid WhatsApp or phone number.") .regex(/^\+?[0-9 ()-]+$/, "Use numbers, spaces, brackets or hyphens only."), date: z.string().date("Choose an appointment date."), time: z.string().min(1, "Choose a preferred time."), service: z.string().min(1, "Choose a service."), notes: z.string().trim().max(700, "Please keep notes under 700 characters."), }); const weekdaySlots = getAvailableAppointmentSlots(1); export const Route = createFileRoute("/")({ ssr: false, head: () => ({ meta: [ { title: "Apex Dental Services | Private Dental Care in Abuja" }, { name: "description", content: "Discover thoughtful cosmetic, restorative and family dentistry at Apex Dental Services, Suite 214, Jinifa Plaza, Abuja.", }, { property: "og:title", content: "Apex Dental Services | Abuja" }, { property: "og:description", content: "Precision cosmetic, restorative and family dentistry at Suite 214, Jinifa Plaza, Abuja.", }, { property: "og:type", content: "website" }, { name: "twitter:card", content: "summary_large_image" }, ], }), component: ApexDentalHome, }); function ApexDentalHome() { const [mobileNavOpen, setMobileNavOpen] = useState(false); const [openingStatus, setOpeningStatus] = useState(() => getAbujaOpeningStatus(new Date())); const [selectedDate, setSelectedDate] = useState(""); const [selectedTime, setSelectedTime] = useState(""); const [comparison, setComparison] = useState(54); const [formMessage, setFormMessage] = useState(""); const [sending, setSending] = useState(false); const [confirmation, setConfirmation] = useState<{ name: string; date: string; time: string; code: string; } | null>(null); const [today, setToday] = useState(""); useEffect(() => { const updateLocalStatus = () => setOpeningStatus(getAbujaOpeningStatus(new Date())); updateLocalStatus(); const interval = window.setInterval(updateLocalStatus, 60_000); const localDate = new Date(); const year = localDate.getFullYear(); const month = String(localDate.getMonth() + 1).padStart(2, "0"); const day = String(localDate.getDate()).padStart(2, "0"); setToday(`${year}-${month}-${day}`); return () => window.clearInterval(interval); }, []); const availableSlots = selectedDate ? getAvailableAppointmentSlots(new Date(`${selectedDate}T12:00:00`).getDay()) : weekdaySlots; const closeNav = () => setMobileNavOpen(false); async function submitBooking(event: FormEvent) { event.preventDefault(); setFormMessage(""); const form = event.currentTarget; const formData = new FormData(form); const parsed = bookingSchema.safeParse({ name: formData.get("name"), phone: formData.get("phone"), date: formData.get("date"), time: formData.get("time"), service: formData.get("service"), notes: formData.get("notes") ?? "", }); if (!parsed.success) { setFormMessage(parsed.error.issues[0]?.message ?? "Please check your appointment details."); return; } const chosenDay = new Date(`${parsed.data.date}T12:00:00`).getDay(); if (!getAvailableAppointmentSlots(chosenDay).includes(parsed.data.time)) { setFormMessage("Choose a time during the clinic’s opening hours."); return; } const endpoint = import.meta.env["VITE_FORMSPREE_ENDPOINT"]?.trim(); if (!endpoint || !/^https:\/\/formspree\.io\/f\/[a-zA-Z0-9]+$/.test(endpoint)) { setFormMessage("The appointment form is ready; its secure Formspree address still needs to be connected."); return; } setSending(true); try { formData.set("_subject", `Appointment request — ${parsed.data.name}`); formData.set("appointment-time", formatTime(parsed.data.time)); const response = await fetch(endpoint, { method: "POST", body: formData, headers: { Accept: "application/json" }, }); if (!response.ok) { setFormMessage("Your request could not be sent. Please try WhatsApp instead."); return; } setConfirmation({ name: parsed.data.name, date: new Date(`${parsed.data.date}T12:00:00`).toLocaleDateString("en-NG", { dateStyle: "long", }), time: formatTime(parsed.data.time), code: `APX-${crypto.randomUUID().slice(0, 6).toUpperCase()}`, }); form.reset(); setSelectedDate(""); setSelectedTime(""); } catch { setFormMessage("We couldn’t reach the booking service. Please try WhatsApp instead."); } finally { setSending(false); } } return (

A brighter, more confident smile begins here.

{openingStatus.isOpen ? "Open now" : "Closed now"} · {openingStatus.isOpen ? `Closes ${openingStatus.closesAt}` : "Appointments available"}
Apex Dental Clinic PRIVATE DENTAL CARE ABUJA, NIGERIA

OUR APPROACH

Considered care.
Confident smiles.

From your first check-up to a complete smile transformation, find the care that feels right for you.

{services.map(({ number, title, detail, icon: Icon, tag }) => ( ))}

A WARMER KIND OF DENTISTRY

Good care starts
with feeling at ease.

We believe a visit to the dentist can feel different. From the moment you arrive at Jinifa Plaza, our team is here to listen, understand your goals and make every visit feel a little more comfortable.

A welcoming, thoughtfully designed clinic
Care shaped around your comfort and goals
Clear conversations before every treatment
The Apex Dental Clinic reception, photographed at Jinifa Plaza.
01 YOUR SPACE TO SMILE
A glimpse of the Apex Dental Clinic patient lounge.
MADE TO FEEL WELCOMING
APEXABUJA
NIGERIA
✳

THE SMILE STUDIO

A vision of
what’s possible.

Every smile is unique. Move the slider to explore a digital smile-design concept—not a real patient result. Your own recommendations begin with a one-to-one consultation.

Talk through your options
setComparison(Number(event.target.value))} className="comparison-range" aria-label="Compare the two illustrative digital smile-design concepts" />
ILLUSTRATIVE DIGITAL SMILE DESIGNNOT A PATIENT BEFORE & AFTER

APEX, THROUGH THEIR EYES

Trusted by Abuja.
Chosen by you.

A good experience is always worth sharing. Thank you for choosing Apex.

Read our Google reviews
5.0
★★★★★ GOOGLE RATING

Our 376+ Google reviews reflect what matters: thoughtful attention, a welcoming space, and care designed around your comfort.

THE THINGS THAT MATTER MOST
376+ GOOGLE REVIEWS · ABUJA, NIGERIA

YOUR NEXT STEP

Let’s talk
about your smile.

Tell us what you’re looking for. We’ll pass your preferred appointment time and contact details to the Apex team.

01 / 01

Request a consultation