"use client"; import { useRef } from "react"; import { useConfiguratorStore } from "@/lib/store"; import * as THREE from "three"; export function Door3D() { const { doorType, gridType, finish, handle } = useConfiguratorStore(); const doorRef = useRef(null); // Frame color based on finish const frameColor = { zwart: "#1a1a1a", brons: "#8B6F47", grijs: "#525252", }[finish]; // Door dimensions (more realistic proportions) const doorWidth = doorType === "paneel" ? 1.5 : 1.2; const doorHeight = 2.4; const frameThickness = 0.03; // Slim steel profile (3cm) const frameDepth = 0.05; // Depth of frame const glassThickness = 0.015; // Realistic glass thickness // Calculate grid divider positions const getDividerPositions = () => { if (gridType === "3-vlak") { return [-doorHeight / 3, doorHeight / 3]; } else if (gridType === "4-vlak") { return [-doorHeight / 2, 0, doorHeight / 2]; } return []; }; const dividerPositions = getDividerPositions(); return ( {/* Outer Frame - Top */} {/* Outer Frame - Bottom */} {/* Outer Frame - Left */} {/* Outer Frame - Right */} {/* Glass Panel - Premium Physical Material */} {/* Horizontal Dividers (Grid) - Slim profiles */} {dividerPositions.map((yPos, index) => ( ))} {/* Vertical Divider for Paneel */} {doorType === "paneel" && ( )} {/* Handle - U-Greep for Taats */} {doorType === "taats" && handle === "u-greep" && ( )} {/* Handle - Klink for Scharnier */} {doorType === "scharnier" && handle === "klink" && ( )} ); }