From e2734883ba1c31bb568437156980ffacd9a507f6 Mon Sep 17 00:00:00 2001 From: jyswee Date: Thu, 23 Jul 2026 22:11:45 +0000 Subject: [PATCH] Seed: real-estate template (18 files) --- src/pages/PropertyDetail.tsx | 246 +++++++++++++++++++++++++++++++++++ 1 file changed, 246 insertions(+) create mode 100644 src/pages/PropertyDetail.tsx diff --git a/src/pages/PropertyDetail.tsx b/src/pages/PropertyDetail.tsx new file mode 100644 index 0000000..5c50abf --- /dev/null +++ b/src/pages/PropertyDetail.tsx @@ -0,0 +1,246 @@ +import { useState } from "react"; +import { 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 { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; +import { + Bed, Bath, Maximize, Car, MapPin, Home, Check, Phone, Mail, + Calendar, ChevronLeft, ZoomIn, Heart +} from "lucide-react"; +import { toast } from "sonner"; +import Header from "@/components/Header"; +import Footer from "@/components/Footer"; +import { useSaasMutation } from "@/hooks/use-tygarun"; + +const features = [ + "Hardwood Floors", "Central Air Conditioning", "Gourmet Kitchen", "Walk-in Closets", + "Smart Home System", "Wine Cellar", "Home Theater", "Heated Pool", + "3-Car Garage", "Landscaped Gardens", "Security System", "Solar Panels", +]; + +const similar = [ + { name: "Sunset Terrace Villa", price: "$3,200,000", beds: "3", baths: "2", sqft: "2,100", gradient: "from-emerald-800/40 to-stone-700/40" }, + { name: "Palm Canyon Retreat", price: "$4,100,000", beds: "4", baths: "3", sqft: "3,400", gradient: "from-stone-700/40 to-amber-800/40" }, + { name: "Brentwood Modern", price: "$5,500,000", beds: "5", baths: "4", sqft: "4,800", gradient: "from-amber-800/40 to-emerald-900/40" }, +]; + +export default function PropertyDetailPage() { + // toast from sonner (imported above) + const [mainImg, setMainImg] = useState(0); + const [viewingOpen, setViewingOpen] = useState(false); + const { mutate: bookViewing, loading: booking } = useSaasMutation("scheduling", "/bookings"); + + const handleBookViewing = async (e: React.FormEvent) => { + e.preventDefault(); + const fd = new FormData(e.currentTarget); + try { + await bookViewing({ + name: fd.get("name"), + email: fd.get("email"), + date: fd.get("date"), + property: "The Belmont Estate", + }); + toast.success("Viewing booked! An agent will confirm by email."); + setViewingOpen(false); + e.currentTarget.reset(); + } catch { + toast.error("Could not book viewing. Please try again."); + } + }; + const thumbGrads = [ + "from-emerald-800/40 to-stone-700/40", + "from-stone-700/40 to-amber-800/40", + "from-amber-800/40 to-emerald-900/40", + "from-emerald-900/40 to-stone-800/40", + "from-stone-800/40 to-emerald-800/40", + ]; + + return ( +
+
+ +
+
+ {/* Back */} + + Back to Properties + + + {/* ── IMAGE GALLERY ── */} +
+ + +
+ +
+ +
+ For Sale + +
+
+ +
+ +
+
+
+
+ {thumbGrads.map((g, i) => ( + + ))} +
+
+ +
+ {/* ── LEFT: Property Info ── */} +
+
+
+

The Belmont Estate

+
1240 Belmont Drive, Beverly Hills, CA 90210
+
+ Single Family Home +
+ +
$4,750,000
+ + {/* Stats Grid */} +
+ {[ + { icon: Bed, val: "6", label: "Bedrooms" }, + { icon: Bath, val: "5", label: "Bathrooms" }, + { icon: Maximize, val: "6,800", label: "Square Feet" }, + { icon: Car, val: "3-Car", label: "Garage" }, + ].map((s, i) => ( +
+ +
{s.val}
+
{s.label}
+
+ ))} +
+ + {/* Description */} +
+

About This Property

+

Welcome to The Belmont Estate, a stunning architectural masterpiece nestled in the prestigious hills of Beverly Hills. This extraordinary residence offers an unparalleled blend of luxury, sophistication, and modern comfort across nearly 7,000 square feet of meticulously designed living space.

+

The open-concept floor plan seamlessly connects the gourmet chef's kitchen, formal dining room, and expansive living areas, all bathed in natural light from floor-to-ceiling windows. Step outside to discover the resort-style backyard featuring a heated infinity pool, outdoor kitchen, and lush landscaped gardens with panoramic city views.

+
+ + {/* Features */} +
+

Features & Amenities

+
+ {features.map((f) => ( +
+ {f} +
+ ))} +
+
+ + {/* Map Placeholder */} +
+

Location

+
+
+ +

Interactive Map

+
+
+
+
+ + {/* ── RIGHT: Agent Card ── */} +
+ + +
+
JR
+

Jennifer Rodriguez

+

Senior Listing Agent

+
+
+
+ +1 (310) 555-0147 +
+
+ jennifer@prestigerealty.com +
+
+ + + + + + + Book a Viewing + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+ +
+
+
+
+ + {/* ── SIMILAR ── */} +
+

Similar Properties

+
+ {similar.map((p, i) => ( + + +
+ +
+ +
{p.price}
+
{p.name}
+
+ {p.beds} + {p.baths} + {p.sqft} +
+
+
+ + ))} +
+
+
+
+ +
+ ); +} \ No newline at end of file