"use client";
import { useConfiguratorStore } from "@/lib/store";
export function DoorVisualizer() {
const { doorType, gridType, finish, handle } = useConfiguratorStore();
// Frame color mapping based on finish
const frameColor = {
zwart: "#1f1f1f",
brons: "#8B6F47",
grijs: "#525252",
}[finish];
// Door width varies by type
const doorWidth = doorType === "paneel" ? "w-[300px]" : "w-[240px]";
// Grid configuration
const gridConfig = {
"3-vlak": "grid-rows-3",
"4-vlak": "grid-rows-4",
geen: "",
}[gridType];
return (
{/* Background room image with overlay */}
{/* Live Preview Badge */}
{/* The Door Frame (CSS-based) */}
{/* The Glass Panels with Grid */}
{gridType !== "geen" ? (
{gridType === "3-vlak" &&
[1, 2, 3].map((i) => (
))}
{gridType === "4-vlak" &&
[1, 2, 3, 4].map((i) => (
))}
) : (
// No grid - single glass panel
)}
{/* Handle Overlays */}
{doorType === "taats" && handle === "u-greep" && (
)}
{doorType === "scharnier" && handle === "klink" && (
)}
{doorType === "paneel" && (
// Central vertical divider for paneel
)}
{/* Configuration Info Card */}
);
}