"use client" import { useState, useRef } from "react" import { Button } from "@/components/ui/button" import { Card, CardContent } from "@/components/ui/card" import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" import { Badge } from "@/components/ui/badge" import { Slider } from "@/components/ui/slider" import { Switch } from "@/components/ui/switch" import { MapPin, Home, BarChart2, Filter, MessageCircle, X, Plus, Minus, Droplets, Wind, Sun, LineChart, Send, Newspaper, Building, BedDouble, Bath, Star, Clock, ChevronDown, Check, RefreshCw, } from "lucide-react" import Link from "next/link" import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu" export default function MapsPage() { const [showFilters, setShowFilters] = useState(false) const [showAnalytics, setShowAnalytics] = useState(false) const [showChat, setShowChat] = useState(false) const [showPropertyInfo, setShowPropertyInfo] = useState(false) const [activeTab, setActiveTab] = useState("basic") const [priceRange, setPriceRange] = useState([5000000, 20000000]) const [radius, setRadius] = useState(30) const [message, setMessage] = useState("") const [messages, setMessages] = useState([{ role: "assistant", content: "Hi! How can I help you today?" }]) const [mapZoom, setMapZoom] = useState(14) const [selectedModel, setSelectedModel] = useState("Standard ML Model v2.4") const mapRef = useRef(null) const models = [ "Standard ML Model v2.4", "Enhanced Neural Network v1.8", "Geospatial Regression v3.1", "Time Series Forecast v2.0", "Custom Model (User #1242)", ] const handleSendMessage = () => { if (message.trim()) { setMessages([...messages, { role: "user", content: message }]) // Simulate AI response setTimeout(() => { setMessages((prev) => [ ...prev, { role: "assistant", content: "I can provide information about properties in this area. Would you like to know about flood risks, air quality, or nearby amenities?", }, ]) }, 1000) setMessage("") } } const handleZoomIn = () => { setMapZoom((prev) => Math.min(prev + 1, 20)) } const handleZoomOut = () => { setMapZoom((prev) => Math.max(prev - 1, 10)) } const handlePropertyClick = () => { setShowPropertyInfo(true) setShowFilters(false) setShowChat(false) } return (
{/* Map Container */}
{/* Map Placeholder - In a real implementation, this would be a map component */}
Map View
{/* Sample Property Markers */}
Available
Pending
Sold
{/* Top Navigation Bar */}
BorBann
{models.map((model) => ( setSelectedModel(model)} className="flex items-center gap-2" > {model === selectedModel && } {model} ))} Manage Models...
{/* Map Controls */}
{/* Map Overlay Controls */}
{/* Property Info Panel */} {showPropertyInfo && (
Property Details
Property
Condominium Premium

Modern Condominium

Sukhumvit, Bangkok
3 Beds
2 Baths
150 m²
฿15,000,000

Environmental Factors

Flood Risk Moderate
Air Quality Poor
Noise Low

Nearby Facilities

BTS Phrom Phong 300m
EmQuartier Mall 500m
Benchasiri Park 700m
)} {/* Analytics Panel */} {showAnalytics && (
Analytics

Information in radius will be analyzed

Using: {selectedModel}
Area Price History

10,000,000 Baht

Overall Price History of this area

{/* Simple line chart simulation */}
Price Prediction

15,000,000 Baht

The estimated price based on various factors.

{/* Simple line chart simulation */}
Flood Factor Moderate
Air Factor Bad
{/* Local News Section */}

Local News

New BTS Extension Planned

The BTS Skytrain will be extended to cover more areas in Sukhumvit by 2025.

2 days ago
Property Tax Changes

New property tax regulations will take effect next month affecting luxury condominiums.

1 week ago
)} {/* Filters Panel */} {showFilters && (
Property Filters
Basic Advanced
setRadius(value[0])} className="flex-1" /> {radius} km
฿{priceRange[0].toLocaleString()} ฿{priceRange[1].toLocaleString()}
setPriceRange(value)} />
Low Flood Risk
Good Air Quality
Low Noise Pollution
)} {/* Chat Panel */} {showChat && (
Chat Assistant
{messages.map((msg, index) => (
{msg.content}
))}
setMessage(e.target.value)} onKeyDown={(e) => { if (e.key === "Enter") handleSendMessage() }} />
)} {/* Map Legend */}
Property Status
Available
Pending
Sold
) }