'use client'; import { useState, useEffect } from 'react'; import Image from 'next/image'; import Link from 'next/link'; import Header from "@/components/Header"; import MetroLine from "@/components/MetroLine"; import Footer from "@/components/Footer"; import { newsData } from '@/data/news'; // Hero Slider Data - Component dışında tanımla const heroSlides = [ { id: 1, title: 'Ankara Metro Altyapı Projelerinde Öncü Çözümler', description: 'Ankara Büyükşehir Belediyesi ile birlikte, modern teknoloji ve mühendislik uzmanlığımızla başkentin ulaşım ağını inşa ediyor, geleceğin metro sistemlerini bugünden hayata geçiriyoruz.', buttonText: 'Detayları Gör', buttonLink: '#proje-detay' }, { id: 2, title: 'A2 Metro Hattı İnşaatında Son Aşamaya Gelindi', description: '15 istasyonlu A2 Metro Hattı projemiz %75 tamamlandı. 2026 yılında hizmete açılacak modern metro hattımız, günlük 300 bin yolcuya hizmet verecek.', buttonText: 'İlerlemeyi İzle', buttonLink: '#metro-hatti' }, { id: 3, title: 'Çevre Dostu Metro Teknolojileri', description: 'Yenilenebilir enerji kaynakları ve sürdürülebilir inşaat teknikleri ile çevre dostu metro projelerine imza atıyoruz. Karbon emisyonunu %40 azaltan yenilikçi çözümlerimiz.', buttonText: 'Yeşil Projeler', buttonLink: '#cevre' }, { id: 4, title: 'Güvenli İnşaat, Güvenli Gelecek', description: 'ISO 45001 sertifikalı iş güvenliği sistemlerimiz ile 2000+ çalışanımızın güvenliğini en üst düzeyde tutuyoruz. Sıfır iş kazası hedefiyle çalışıyoruz.', buttonText: 'Güvenlik Önlemleri', buttonLink: '#guvenlik' } ]; export default function Home() { const [showLiveStream, setShowLiveStream] = useState(false); const [showNews, setShowNews] = useState(false); const [selectedNews, setSelectedNews] = useState(null); const [showDocuments, setShowDocuments] = useState(false); const [selectedCategory, setSelectedCategory] = useState('all'); const [showMediaGallery, setShowMediaGallery] = useState(false); const [selectedMediaTab, setSelectedMediaTab] = useState<'all' | 'video' | 'photo'>('all'); const [selectedMedia, setSelectedMedia] = useState(null); const [showComplaintForm, setShowComplaintForm] = useState(false); const [complaintFormData, setComplaintFormData] = useState({ name: '', email: '', phone: '', subject: '', type: 'dilek', message: '' }); const [showContact, setShowContact] = useState(false); const [currentSlide, setCurrentSlide] = useState(0); // Modal açıldığında yukarı kaydır useEffect(() => { if (showLiveStream || showNews || showDocuments || showMediaGallery || showComplaintForm || showContact) { window.scrollTo({ top: 0, behavior: 'smooth' }); } }, [showLiveStream, showNews, showDocuments, showMediaGallery, showComplaintForm, showContact]); // Auto slider useEffect(() => { const timer = setInterval(() => { setCurrentSlide((prev) => (prev + 1) % 4); // 4 slide var }, 10000); // 10 saniyede bir değiş return () => clearInterval(timer); }, []); const categories = [ { id: 'all', name: 'Tümü', icon: '📋' }, { id: 'ihale', name: 'İhale Belgeleri', icon: '📄' }, { id: 'teknik', name: 'Teknik Dökümanlar', icon: '📐' }, { id: 'cevresel', name: 'Çevresel Etki', icon: '🌱' }, { id: 'raporlar', name: 'İlerleme Raporları', icon: '📊' }, ]; const documents = [ { id: 1, title: "A2 Metro Hattı İhale Şartnamesi", category: 'ihale', date: "15 Ocak 2025", size: "2.4 MB", type: "PDF", description: "Metro inşaatı için teknik şartname ve ihale koşulları" }, { id: 2, title: "Proje Teknik Çizimleri", category: 'teknik', date: "10 Şubat 2025", size: "15.8 MB", type: "DWG", description: "Tüm istasyonların teknik mimari çizimleri" }, { id: 3, title: "Çevresel Etki Değerlendirme Raporu", category: 'cevresel', date: "5 Mart 2025", size: "4.2 MB", type: "PDF", description: "Proje çevresel etki analizi ve önlemler" }, { id: 4, title: "2025 Mart Ayı İlerleme Raporu", category: 'raporlar', date: "1 Nisan 2025", size: "1.8 MB", type: "PDF", description: "Aylık proje ilerleme ve istatistikler" }, { id: 5, title: "Güvenlik Planı ve Prosedürleri", category: 'teknik', date: "20 Ocak 2025", size: "3.1 MB", type: "PDF", description: "İnşaat sahası güvenlik protokolleri" }, { id: 6, title: "İstasyon Tasarım Detayları", category: 'teknik', date: "8 Şubat 2025", size: "8.5 MB", type: "PDF", description: "İstasyon iç ve dış mekan tasarım detayları" }, { id: 7, title: "Finansman Planı", category: 'ihale', date: "12 Ocak 2025", size: "1.2 MB", type: "XLSX", description: "Proje bütçe ve finansman dağılımı" }, { id: 8, title: "2025 Nisan Ayı İlerleme Raporu", category: 'raporlar', date: "1 Mayıs 2025", size: "2.1 MB", type: "PDF", description: "Aylık proje ilerleme ve istatistikler" }, { id: 9, title: "Gürültü ve Titreşim Analizi", category: 'cevresel', date: "18 Mart 2025", size: "3.8 MB", type: "PDF", description: "Çevre gürültü ve titreşim ölçüm sonuçları" }, ]; const filteredDocs = selectedCategory === 'all' ? documents : documents.filter(doc => doc.category === selectedCategory); const getFileIcon = (type: string) => { switch (type) { case 'PDF': return '📕'; case 'DWG': return '📐'; case 'XLSX': return '📊'; default: return '📄'; } }; // Featured news (ana sayfada gösterilecek haberler) const featuredNews = newsData.filter(news => news.featured).slice(0, 4); const mediaItems = [ { id: 1, type: 'video', title: 'A2 Metro Hattı Genel Tanıtım', thumbnail: 'https://images.pexels.com/photos/17152223/pexels-photo-17152223.jpeg', videoUrl: 'https://www.youtube.com/embed/b9q88QDEcKg', date: '15 Ekim 2025', duration: '5:32', description: 'A2 Metro Hattı projesinin genel tanıtımı ve istasyonların detayları' }, { id: 2, type: 'photo', title: 'Dikimevi İstasyonu İnşaat Çalışmaları', thumbnail: 'https://images.pexels.com/photos/17302615/pexels-photo-17302615.jpeg', date: '12 Ekim 2025', description: 'Dikimevi metro istasyonunda devam eden kazı ve inşaat çalışmaları' }, { id: 3, type: 'photo', title: 'Tuzluçayır İstasyonu Temel Atma', thumbnail: 'https://images.pexels.com/photos/33950678/pexels-photo-33950678.jpeg', date: '10 Ekim 2025', description: 'Tuzluçayır istasyonunun temel atma töreni anları' }, { id: 4, type: 'video', title: 'Metro İnşaatı İlerleme Raporu', thumbnail: 'https://images.pexels.com/photos/253647/pexels-photo-253647.jpeg', videoUrl: 'https://www.youtube.com/embed/b9q88QDEcKg', date: '8 Ekim 2025', duration: '8:15', description: 'Ekim ayı metro inşaatı ilerleme raporu ve gelecek hedefler' }, { id: 5, type: 'photo', title: 'Modern İstasyon Tasarımları', thumbnail: 'https://images.pexels.com/photos/17152223/pexels-photo-17152223.jpeg', date: '5 Ekim 2025', description: 'Yeni nesil metro istasyonlarının modern iç mekan tasarımları' }, { id: 6, type: 'video', title: 'Çevre Dostu Metro Projesi', thumbnail: 'https://images.pexels.com/photos/17302615/pexels-photo-17302615.jpeg', videoUrl: 'https://www.youtube.com/embed/b9q88QDEcKg', date: '1 Ekim 2025', duration: '6:45', description: 'Metro projesinde kullanılan çevre dostu teknolojiler ve sürdürülebilir yaklaşımlar' }, { id: 7, type: 'photo', title: 'İşçi Güvenliği Eğitimi', thumbnail: 'https://images.pexels.com/photos/33950678/pexels-photo-33950678.jpeg', date: '28 Eylül 2025', description: 'İnşaat sahalarında iş güvenliği eğitimleri' }, { id: 8, type: 'photo', title: 'Ray Döşeme Çalışmaları', thumbnail: 'https://images.pexels.com/photos/253647/pexels-photo-253647.jpeg', date: '25 Eylül 2025', description: 'Metro hattında ray döşeme işlemlerinin başlaması' }, ]; const filteredMedia = selectedMediaTab === 'all' ? mediaItems : mediaItems.filter(item => item.type === selectedMediaTab); return (
{/* Hero Video Section */}
{/* Video Background */}
{/* Dark Overlay */}
{/* Content Overlay */}
{/* Slider Content */}
{heroSlides.map((slide, index) => (

{slide.title}

{slide.description}

{/* Action Buttons - Mobilde gizle */}
))}
{/* Pagination Dots & Navigation */}
{/* Dots */}
{heroSlides.map((_, index) => (
{/* Arrow Navigation */}
{/* Alt Menü Kartları - Mobilde normal akış, Desktop'ta overlay */}
{/* Canlı Yayın */} {/* Haberler */} {/* Belgeler */} {/* Medya Galerisi */} {/* Dilek-Şikayet */} {/* E-İletişim */}
{/* Canlı Yayın Video Bölümü */} {showLiveStream && (

Canlı Yayın

{/* YouTube Video Embed */}

A2 Metro Hattı İnşaat Çalışmaları - Canlı Yayın

)} {/* Haberler Bölümü */} {showNews && (

Son Haberler

Tümünü Gör
{/* Haberler Grid veya Detay */} {selectedNews === null ? (
{featuredNews.map((news) => (
{/* Haber Görseli */}
{news.title}
{/* Haber İçeriği */}
{news.date}

{news.title}

{news.summary}

))}
) : ( /* Haber Detayı */
{newsData.filter(n => n.id === selectedNews).map((news) => (
{/* Geri Butonu */} {/* Detay İçerik */}
{/* Büyük Görsel */}
{news.title}
{/* Detay Metni */}
{news.date}

{news.title}

{news.content}

{/* Alt Bilgi */}
Paylaş:
))}
)}
)} {/* Belgeler Bölümü */} {showDocuments && (

Proje Belgeleri

{/* Kategori Filtreleri */}
{categories.map((cat) => ( ))}
{/* Belgeler Grid - 3 sütunlu */}
{filteredDocs.map((doc) => (
{/* Dosya İkonu - Üstte ortalı */}
{getFileIcon(doc.type)}
{/* Belge Bilgileri */}

{doc.title}

{doc.description}

📅 {doc.date} 📄 {doc.type} 💾 {doc.size}
{/* İndirme Butonu - Alt kısımda */}
))}
)} {/* Medya Galerisi Bölümü */} {showMediaGallery && (

Medya Galerisi

{/* Medya Grid veya Detay */} {selectedMedia === null ? ( <> {/* Tab Menü */}
{/* Medya Grid */}
{filteredMedia.map((item) => (
setSelectedMedia(item.id)} className="bg-gray-50 rounded-xl overflow-hidden hover:shadow-lg transition-all duration-300 hover:-translate-y-2 cursor-pointer group" > {/* Thumbnail */}
{item.title} {/* Video Badge */} {item.type === 'video' && (
)} {/* Duration Badge */} {item.type === 'video' && 'duration' in item && (
{item.duration}
)} {/* Photo Badge */} {item.type === 'photo' && (
FOTO
)}
{/* Content */}
{item.date}

{item.title}

{item.description}

))}
) : ( /* Medya Detayı */
{mediaItems.filter(m => m.id === selectedMedia).map((item) => (
{/* Geri Butonu */} {/* Video Player veya Büyük Fotoğraf */} {item.type === 'video' ? (
) : (
{item.title}
)} {/* Bilgiler */}
{item.date} {item.type === 'video' && 'duration' in item && ( <> {item.duration} )}

{item.title}

{item.description}

{/* Paylaş */}
Paylaş:
))}
)}
)} {/* Dilek-Şikayet Formu */} {showComplaintForm && (

Dilek ve Şikayet Formu

{/* Bilgilendirme */}

A2 Metro Hattı projesi ile ilgili dilek, öneri ve şikayetlerinizi bu form aracılığıyla iletebilirsiniz. Başvurularınız en kısa sürede değerlendirilecektir.

{/* Form */}
{ e.preventDefault(); alert('Form gönderildi! (Demo)'); setShowComplaintForm(false); setComplaintFormData({ name: '', email: '', phone: '', subject: '', type: 'dilek', message: '' }); }}> {/* Başvuru Tipi */}
{/* İki Sütunlu Alan */}
{/* Ad Soyad */}
setComplaintFormData({...complaintFormData, name: e.target.value})} className="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#00B4D8] focus:border-transparent outline-none transition-all text-gray-900 placeholder:text-gray-500" placeholder="Adınız ve Soyadınız" />
{/* E-posta */}
setComplaintFormData({...complaintFormData, email: e.target.value})} className="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#00B4D8] focus:border-transparent outline-none transition-all text-gray-900 placeholder:text-gray-500" placeholder="ornek@email.com" />
{/* Telefon */}
setComplaintFormData({...complaintFormData, phone: e.target.value})} className="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#00B4D8] focus:border-transparent outline-none transition-all text-gray-900 placeholder:text-gray-500" placeholder="0(5__) ___ __ __" />
{/* Konu */}
setComplaintFormData({...complaintFormData, subject: e.target.value})} className="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#00B4D8] focus:border-transparent outline-none transition-all text-gray-900 placeholder:text-gray-500" placeholder="Başvuru konusu" />
{/* Mesaj */}
{/* KVKK Onayı */}
{/* Butonlar */}
)} {/* E-İletişim Bölümü */} {showContact && (

İletişim Bilgileri

{/* Sol Taraf - İletişim Kartları */}
{/* Adres Kartı */}

ADRES

Emniyet Mah. Hipodrom Caddesi No: 5
Yenimahalle / Ankara

{/* KEP Adresi Kartı */} {/* Telefon Kartı */} {/* Çalışma Saatleri */}

ÇALIŞMA SAATLERİ

Hafta İçi: 08:30 - 17:30
Hafta Sonu: Kapalı

{/* Sağ Taraf - Harita */}

Konum

{/* Haritada Göster Butonu */} Google Maps'te Aç
)} {/* Ana İçerik - Kartlar için üstten boşluk */}

Metro Hat Durumları

Ankara Metro hatları ve durak bilgileri. Metro treni şu anda hangi durakta görebilirsiniz.

{/* Metro İnşaat Projesi - Animasyonlu */}
{/* Footer */}
); }