"use client"; import { useState, useRef } from "react"; import Link from "next/link"; import { properties } from "@/data/properties"; type Category = "Apartments" | "Premium Homes" | "Luxury"; interface PropertiesProps { layout?: "slider" | "grid"; } export default function Properties({ layout = "slider" }: PropertiesProps) { const [activeTab, setActiveTab] = useState("All"); const scrollContainerRef = useRef(null); const filteredProperties = activeTab === "All" ? properties : properties.filter((property) => property.category === activeTab); const scroll = (direction: "left" | "right") => { if (scrollContainerRef.current) { const container = scrollContainerRef.current; const scrollAmount = direction === "left" ? -400 : 400; container.scrollBy({ left: scrollAmount, behavior: "smooth" }); } }; return (

Our Signature Projects

Discover a home that complements your lifestyle.

{/* Tabs */}
{(["All", "Apartments", "Premium Homes", "Luxury"] as const).map((category) => ( ))}
{layout === "slider" ? ( /* Slider Layout - 3 cards for All, 1 card for specific tabs */
{/* Navigation Buttons */} {/* Scrollable Area */}
{filteredProperties.map((property, index) => { // Show only first card for specific tabs if (activeTab !== "All" && index > 0) return null; return (
{/* Image */}
{property.image.startsWith('/') && ( {property.title} )}
{property.status}
{/* Content */}
{property.location}

{property.title}

{property.description}

View Details
); })}
) : ( /* Grid Layout */
{filteredProperties.map((property) => ( {/* Image Placeholder */}
{property.image.startsWith('/') && ( {property.title} )}
{property.status}
{property.location}

{property.title}

{property.description}

View Details
))}
)}
); }