diff --git a/components/FleetList.tsx b/components/FleetList.tsx index 22441de..d452d94 100644 --- a/components/FleetList.tsx +++ b/components/FleetList.tsx @@ -3,6 +3,9 @@ import { useState } from 'react'; import Image from "next/image"; import { cn } from "@/lib/utils"; +import { motion, AnimatePresence } from "framer-motion"; +import { X, Phone, MessageCircle } from "lucide-react"; +import { siteConfig } from "@/lib/data"; interface FleetItem { name: string; @@ -21,11 +24,17 @@ interface FleetListProps { export function FleetList({ items, categories }: FleetListProps) { const [activeCategory, setActiveCategory] = useState("Hepsi"); + const [selectedItem, setSelectedItem] = useState(null); const filteredItems = activeCategory === "Hepsi" ? items : items.filter(item => item.category === activeCategory); + const handleWhatsApp = (itemName: string) => { + const message = encodeURIComponent(`Merhaba, ${itemName} hakkında bilgi almak istiyorum.`); + window.open(`https://wa.me/${siteConfig.contact.whatsapp}?text=${message}`, '_blank'); + }; + return ( <> {/* Filter System */} @@ -90,7 +99,10 @@ export function FleetList({ items, categories }: FleetListProps) { {item.reach} - @@ -98,6 +110,84 @@ export function FleetList({ items, categories }: FleetListProps) { ))} + + {/* Detail Modal */} + + {selectedItem && ( +
+ setSelectedItem(null)} + className="absolute inset-0 bg-background/95 backdrop-blur-sm" + /> + + + +
+
+ {selectedItem.name} +
+
+ + {selectedItem.category} + +

+ {selectedItem.name} +

+

+ {selectedItem.description} +

+ +
+
+ Kapasite + {selectedItem.capacity} +
+
+ Erişim + {selectedItem.reach} +
+
+ +
+ + + + Bizi Arayın + +
+
+
+
+
+ )} +
); } diff --git a/components/FleetSection.tsx b/components/FleetSection.tsx index 0eca0f2..cc7d367 100644 --- a/components/FleetSection.tsx +++ b/components/FleetSection.tsx @@ -2,44 +2,16 @@ import { motion } from "framer-motion"; import { cn } from "@/lib/utils"; - -const VEHICLES = [ - { - title: "Liebherr LTM 1100", - category: "Mobil Teleskopik Vinç", - specs: [ - { label: "Kapasite", value: "100 TON" }, - { label: "Bom Uzunluğu", value: "60 METRE" }, - ], - status: "Mevcut", - statusColor: "bg-primary text-on-primary", - image: "https://lh3.googleusercontent.com/aida-public/AB6AXuDz5b4r2KouL9upv0olAupqoFkF2Irw10VTeLh8XSl4F94ujjrHJ6keKViHybvoJlR3RgL-WrvsCYDjKNuVYUdALEH7KEjvZmZm40mxJWzQGN_aFUEllY41CpcYxAmHjiyrkgTKgEh9qZuDQ62Pzi-sffDKM9dv8bNg3YWH-ypFworfKyQiaXgLS0wucMj9LpVlzzl2zXrKv6WTv8hJr986CWoKM8b1mTI8ajgq_2oF9vltwrfrZDT8LYEKtgGSmIM84AAlzqZXwMU", - }, - { - title: "Hiyap 75 Ton", - category: "Kamyon Üstü Vinç", - specs: [ - { label: "Kapasite", value: "75 TON" }, - { label: "Erişim", value: "35 METRE" }, - ], - status: "Mevcut", - statusColor: "bg-primary text-on-primary", - image: "https://lh3.googleusercontent.com/aida-public/AB6AXuCTUgbJ7VOHrnV2PY8AX4lAxBfdbp3hP7HdMRv4RJsWYQv6_coiWlqlodtyBjta-2PoSZnOXc1pKQHpbZGS9_6VLIUPyZ-sUH15ENiBjf466dq7GpPBHpS1uqFXm44tK_ZJ0okneK2mtHwo5h459sPzZ5iXakBitbs70sI0X86VQm2dePia2r1weEXW6Znhn8pOcB_hwLybrmfyEhr-b47X20UbQrbSFp2WCIGZUv4IsAlgn775KDuQH96BvaSLC56kOZG8Q5S9Tu0", - }, - { - title: "Teleskopik Platform", - category: "Yüksek İrtifa Erişimi", - specs: [ - { label: "Yükseklik", value: "45 METRE" }, - { label: "Sepet Kapasitesi", value: "300 KG" }, - ], - status: "Bakımda", - statusColor: "bg-error-container text-white", - image: "https://lh3.googleusercontent.com/aida-public/AB6AXuBfXE8_qXbdFXu-5NJjxR_il3lZOkzp6NaLTMMtNr_1_dO0ohKzutRHZLm3Rs3xuwheOE_PUWTDxIavnRfKcdCpASPX9AlxSuZFWaZKax5RWmgLnIBk-ojo_XghFLjC1ES1ACDK-PdB901GE3AxkMj-lWSFkbU8PaUhJ9XxizBHb4BVtvej64-5uXmm9e99Cax1_Xs8_Hm9L7uR8PRX5teGng9Q1gxbGbFCAQw5WG3cZrPESDEbj4osSFEwW8lokMlO0uB9xsaGZxw", - }, -]; +import { FLEET_ITEMS, siteConfig } from "@/lib/data"; +import Link from "next/link"; +import { MessageCircle } from "lucide-react"; export function FleetSection() { + const handleWhatsApp = (itemName: string) => { + const message = encodeURIComponent(`Merhaba, ${itemName} hakkında bilgi almak istiyorum.`); + window.open(`https://wa.me/${siteConfig.contact.whatsapp}?text=${message}`, '_blank'); + }; + return (
@@ -55,9 +27,9 @@ export function FleetSection() {
- {VEHICLES.map((v, idx) => ( + {FLEET_ITEMS.map((v, idx) => ( -
+
{v.status}
@@ -78,27 +53,41 @@ export function FleetSection() {
-

{v.title}

+

{v.name}

{v.category}
- {v.specs.map(spec => ( -
- {spec.label} - {spec.value} -
- ))} +
+ Kapasite + {v.capacity} +
+
+ Erişim + {v.reach} +
+
+
+ + Detayları Gör + +
-
))} {/* Visual cue for more items */}
- NEXT + NEXT