"use client" import { useOverlayContext } from "./overlay-context" import { AnalyticsPanel } from "./analytics-panel" import { PropertyFilters } from "./property-filters" import { ChatBot } from "./chat-bot" import { OverlayControls } from "./overlay-controls" export function OverlayManager() { const { overlays, toggleOverlay } = useOverlayContext() // Function to ensure overlays stay within viewport bounds const getPositionClasses = (position: string, type: string) => { if (position === "right") { return "right-4" } else if (position === "left") { return "left-4" } return type === "analytics" ? "right-4" : "left-4" } return ( <> {/* Analytics Panel */} {overlays.analytics.visible && (
toggleOverlay("chat")} />
)} {/* Property Filters */} {overlays.filters.visible && (
)} {/* Chat Bot */} {overlays.chat.visible && (
toggleOverlay("chat")} />
)} {/* Overlay Controls */} ) }