diff --git a/src/pages/DoctorDetail.tsx b/src/pages/DoctorDetail.tsx new file mode 100644 index 0000000..597309f --- /dev/null +++ b/src/pages/DoctorDetail.tsx @@ -0,0 +1,169 @@ +import { useParams, Link } from "react-router-dom"; +import { Button } from "@/components/ui/button"; +import { Card, CardContent } from "@/components/ui/card"; +import { Badge } from "@/components/ui/badge"; +import { ArrowLeft, Star, GraduationCap, Clock, Quote } from "lucide-react"; +import { toast } from "sonner"; +import { useSaasMutation } from "@/hooks/use-tygarun"; +import Header from "@/components/Header"; +import Footer from "@/components/Footer"; + +const doctorData: Record = { + chen: { + name: "Dr. Sarah Chen", specialty: "Cardiology", credentials: "MD, FACC", + gradient: "from-sky-400 to-teal-400", + bio: "Dr. Sarah Chen is a board-certified cardiologist with over 15 years of experience in interventional cardiology and preventive heart care. She completed her fellowship at Stanford University Medical Center and is passionate about using the latest evidence-based approaches to help patients achieve optimal cardiovascular health. Dr. Chen has published extensively in peer-reviewed journals and is recognized as a leading voice in women’s heart health.", + education: [ + { school: "Johns Hopkins School of Medicine", degree: "Doctor of Medicine" }, + { school: "Stanford University Medical Center", degree: "Cardiology Fellowship" }, + { school: "American Board of Cardiology", degree: "Board Certification" }, + ], + expertise: ["Interventional Cardiology", "Heart Failure", "Preventive Cardiology", "Echocardiography", "Cardiac Rehab"], + hours: { Mon: "9:00 AM - 5:00 PM", Tue: "9:00 AM - 5:00 PM", Wed: "9:00 AM - 12:00 PM", Thu: "9:00 AM - 5:00 PM", Fri: "9:00 AM - 3:00 PM" }, + reviews: [ + { name: "Margaret S.", rating: 5, text: "Dr. Chen is incredibly thorough and caring. She explained my condition in terms I could understand." }, + { name: "David R.", rating: 5, text: "After my cardiac event, Dr. Chen's expertise and compassion made all the difference in my recovery." }, + ], + }, + okafor: { + name: "Dr. James Okafor", specialty: "Neurology", credentials: "MD, PhD, FAAN", + gradient: "from-teal-400 to-emerald-400", + bio: "Dr. James Okafor is a distinguished neurologist with dual expertise in clinical neurology and neuroscience research. With a PhD from MIT and over 20 years of clinical experience, he brings a unique research-informed perspective to patient care. Dr. Okafor specializes in stroke prevention, epilepsy management, and neurodegenerative conditions, and has been instrumental in advancing treatment protocols at leading medical institutions.", + education: [ + { school: "Harvard Medical School", degree: "Doctor of Medicine" }, + { school: "MIT", degree: "PhD in Neuroscience" }, + { school: "Massachusetts General Hospital", degree: "Neurology Residency" }, + ], + expertise: ["Stroke Treatment", "Epilepsy", "Neurodegenerative Diseases", "Brain Mapping", "Clinical Trials"], + hours: { Mon: "8:00 AM - 4:00 PM", Tue: "8:00 AM - 4:00 PM", Wed: "8:00 AM - 4:00 PM", Thu: "10:00 AM - 6:00 PM", Fri: "8:00 AM - 2:00 PM" }, + reviews: [ + { name: "Thomas K.", rating: 5, text: "Dr. Okafor is brilliant and deeply empathetic. His approach to my neurological condition was life-changing." }, + { name: "Lisa M.", rating: 5, text: "The best neurologist I have ever seen. Takes time to listen and creates personalized treatment plans." }, + ], + }, +}; + +const fallback = doctorData.chen; + +export default function DoctorDetailPage() { + const { id } = useParams(); + const doc = doctorData[id || ""] || fallback; + const { mutate: bookDoctor, loading: booking } = useSaasMutation("scheduling", "/bookings"); + + const handleBook = async () => { + try { + await bookDoctor({ doctor: doc.name, specialty: doc.specialty }); + toast.success(`Appointment request sent for \${doc.name}`, { + description: "Our scheduling team will contact you within 24 hours to confirm.", + }); + } catch { + toast.error("Could not submit request. Please call us or try again."); + } + }; + + return ( +
+
+ +
+
+ + Back to All Doctors + + + {/* ── PROFILE HEADER ── */} +
+
+ {doc.name.split(" ").slice(-2).map((n: string) => n[0]).join("")} +
+
+

{doc.name}

+ {doc.specialty} +

{doc.credentials}

+
+
+ + {/* ── BIO ── */} +
+

{doc.bio}

+
+ + {/* ── EDUCATION ── */} +
+

Education & Training

+
+ {doc.education.map((e: any, i: number) => ( +
+
+
+
{e.school}
+
{e.degree}
+
+
+ ))} +
+
+ + {/* ── EXPERTISE ── */} +
+

Areas of Expertise

+
+ {doc.expertise.map((e: string, i: number) => ( + {e} + ))} +
+
+ + {/* ── OFFICE HOURS ── */} +
+

Office Hours

+ + + + + {Object.entries(doc.hours).map(([day, time]) => ( + + + + + ))} + +
{day}{time as string}
+
+
+
+ + {/* ── BOOK CTA ── */} +
+ +
+ + {/* ── PATIENT REVIEWS ── */} +
+

Patient Reviews

+
+ {doc.reviews.map((r: any, i: number) => ( + + +
+ {Array.from({ length: r.rating }).map((_, si) => ( + + ))} +
+ +

{r.text}

+ {r.name} +
+
+ ))} +
+
+
+
+ +
+ ); +} \ No newline at end of file