diff --git a/app/belgeler/page.tsx b/app/belgeler/page.tsx index 240be89..559836c 100644 --- a/app/belgeler/page.tsx +++ b/app/belgeler/page.tsx @@ -1,145 +1,40 @@ 'use client'; -import { useState } from 'react'; +import { useState, useEffect } from 'react'; import Header from "@/components/Header"; import Footer from "@/components/Footer"; +import { dataStore } from '@/lib/dataStore'; +import type { Document } from '@/data/documents'; export default function Documents() { + const [documents, setDocuments] = useState([]); const [selectedCategory, setSelectedCategory] = useState('all'); - const categories = [ - { id: 'all', name: 'Tümü', icon: '📁' }, - { id: 'technical', name: 'Teknik Dokümanlar', icon: '📐' }, - { id: 'reports', name: 'Raporlar', icon: '📊' }, - { id: 'permissions', name: 'İzinler', icon: '✅' }, - { id: 'presentations', name: 'Sunumlar', icon: '📽️' }, - ]; + useEffect(() => { + setDocuments(dataStore.getDocuments()); + }, []); - const documents = [ - { - id: 1, - category: 'technical', - title: 'A2 Metro Hattı Teknik Şartnamesi', - description: 'Proje kapsamındaki tüm teknik detaylar', - date: '15 Ekim 2025', - size: '12.5 MB', - type: 'PDF', - icon: '📐', - }, - { - id: 2, - category: 'technical', - title: 'İstasyon Mimari Projesi', - description: 'İstasyon binalarının mimari tasarımı', - date: '12 Ekim 2025', - size: '25.8 MB', - type: 'PDF', - icon: '🏗️', - }, - { - id: 3, - category: 'technical', - title: 'Güvenlik Planı ve Prosedürleri', - description: 'İş güvenliği planı ve acil durum prosedürleri', - date: '10 Ekim 2025', - size: '6.8 MB', - type: 'PDF', - icon: '🛡️', - }, - { - id: 4, - category: 'technical', - title: 'Malzeme Spesifikasyonları', - description: 'İnşaatta kullanılacak malzeme detayları', - date: '8 Ekim 2025', - size: '9.2 MB', - type: 'PDF', - icon: '🔧', - }, - { - id: 5, - category: 'reports', - title: 'ÇED Raporu', - description: 'Çevresel Etki Değerlendirme', - date: '5 Ekim 2025', - size: '8.3 MB', - type: 'PDF', - icon: '🌍', - }, - { - id: 6, - category: 'reports', - title: 'Eylül 2025 İlerleme Raporu', - description: 'Aylık proje ilerleme durumu', - date: '1 Ekim 2025', - size: '3.2 MB', - type: 'PDF', - icon: '📈', - }, - { - id: 7, - category: 'reports', - title: 'Ağustos 2025 İlerleme Raporu', - description: 'Aylık proje ilerleme durumu', - date: '1 Eylül 2025', - size: '3.1 MB', - type: 'PDF', - icon: '📈', - }, - { - id: 8, - category: 'permissions', - title: 'İnşaat Ruhsatı', - description: 'Belediye onaylı inşaat ruhsatı belgesi', - date: '5 Eylül 2025', - size: '1.5 MB', - type: 'PDF', - icon: '✅', - }, - { - id: 9, - category: 'permissions', - title: 'Kamulaştırma İzin Belgeleri', - description: 'Proje alanı kamulaştırma işlem belgeleri', - date: '28 Ağustos 2025', - size: '4.7 MB', - type: 'PDF', - icon: '📋', - }, - { - id: 10, - category: 'permissions', - title: 'Çalışma İzin Belgeleri', - description: 'İlgili kurumlardan alınan çalışma izinleri', - date: '15 Ağustos 2025', - size: '2.8 MB', - type: 'PDF', - icon: '📄', - }, - { - id: 11, - category: 'presentations', - title: 'A2 Metro Hattı Tanıtım Sunumu', - description: 'Genel tanıtım ve proje özeti sunumu', - date: '20 Eylül 2025', - size: '15.6 MB', - type: 'PPTX', - icon: '📽️', - }, - { - id: 12, - category: 'presentations', - title: 'Teknik Altyapı Sunumu', - description: 'Tünel ve istasyon altyapı detayları', - date: '15 Eylül 2025', - size: '22.4 MB', - type: 'PPTX', - icon: '🎯', - }, + 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: '📊' }, + { id: 'guvenlik', name: 'Güvenlik', icon: '🛡️' }, ]; const filteredDocs = selectedCategory === 'all' ? documents : documents.filter(d => d.category === selectedCategory); + const getFileIcon = (type: string) => { + switch (type) { + case 'PDF': return '📕'; + case 'DWG': return '📐'; + case 'XLSX': return '📊'; + case 'DOCX': return '📝'; + default: return '📄'; + } + }; + return (
@@ -169,7 +64,7 @@ export default function Documents() {
{filteredDocs.map((doc) => (
-
{doc.icon}
+
{getFileIcon(doc.type)}

{doc.title}

{doc.description}

diff --git a/app/canli-yayin/page.tsx b/app/canli-yayin/page.tsx index 631434c..d256150 100644 --- a/app/canli-yayin/page.tsx +++ b/app/canli-yayin/page.tsx @@ -1,50 +1,41 @@ 'use client'; -import { useState } from 'react'; +import { useState, useEffect } from 'react'; import Image from 'next/image'; import Header from "@/components/Header"; import Footer from "@/components/Footer"; +import { dataStore, type Camera } from '@/lib/dataStore'; export default function LiveStream() { const [selectedCamera, setSelectedCamera] = useState(1); + const [cameras, setCameras] = useState([]); - const cameras = [ - { - id: 1, - name: 'Dikimevi İstasyonu - Ana Giriş', - location: 'Dikimevi', - videoUrl: 'https://www.youtube.com/embed/b9q88QDEcKg?autoplay=1', - status: 'online', - viewers: 1243 - }, - { - id: 2, - name: 'Tuzluçayır İstasyonu - İnşaat Sahası', - location: 'Tuzluçayır', - videoUrl: 'https://www.youtube.com/embed/b9q88QDEcKg?autoplay=1', - status: 'online', - viewers: 856 - }, - { - id: 3, - name: 'A2 Metro Hattı - Tünel Kazı Çalışması', - location: 'Mamak', - videoUrl: 'https://www.youtube.com/embed/b9q88QDEcKg?autoplay=1', - status: 'online', - viewers: 2134 - }, - { - id: 4, - name: 'İstasyon Binası İç Mekan', - location: 'Dikimevi', - videoUrl: 'https://www.youtube.com/embed/b9q88QDEcKg?autoplay=1', - status: 'online', - viewers: 534 + useEffect(() => { + const loadedCameras = dataStore.getCameras() + .filter(cam => cam.status === 'online') + .sort((a, b) => a.order - b.order); + setCameras(loadedCameras); + if (loadedCameras.length > 0) { + setSelectedCamera(loadedCameras[0].id); } - ]; + }, []); const selectedCam = cameras.find(cam => cam.id === selectedCamera) || cameras[0]; + if (!selectedCam) { + return ( +
+
+
+
+

Şu anda aktif kamera bulunmamaktadır.

+
+
+
+
+ ); + } + return (
@@ -92,13 +83,15 @@ export default function LiveStream() { {selectedCam.name}
-
- - - - - {selectedCam.viewers.toLocaleString('tr-TR')} izleyici -
+ {selectedCam.viewers && ( +
+ + + + + {selectedCam.viewers.toLocaleString('tr-TR')} izleyici +
+ )}
diff --git a/app/haberler/page.tsx b/app/haberler/page.tsx index 8883c02..0e32deb 100644 --- a/app/haberler/page.tsx +++ b/app/haberler/page.tsx @@ -1,15 +1,21 @@ 'use client'; -import { useState } from 'react'; +import { useState, useEffect } from 'react'; import Image from 'next/image'; import Header from "@/components/Header"; import Footer from "@/components/Footer"; -import { newsData, categories } from '@/data/news'; +import { dataStore } from '@/lib/dataStore'; +import { categories, type NewsItem } from '@/data/news'; export default function News() { + const [newsData, setNewsData] = useState([]); const [selectedCategory, setSelectedCategory] = useState('all'); const [selectedNews, setSelectedNews] = useState(null); + useEffect(() => { + setNewsData(dataStore.getNews()); + }, []); + const filteredNews = selectedCategory === 'all' ? newsData : newsData.filter(item => item.category === selectedCategory); diff --git a/app/iletisim/page.tsx b/app/iletisim/page.tsx index 8e0073a..97458be 100644 --- a/app/iletisim/page.tsx +++ b/app/iletisim/page.tsx @@ -1,9 +1,19 @@ 'use client'; +import { useState, useEffect } from 'react'; import Header from "@/components/Header"; import Footer from "@/components/Footer"; +import { dataStore, type SiteSettings } from '@/lib/dataStore'; export default function Contact() { + const [settings, setSettings] = useState(null); + + useEffect(() => { + setSettings(dataStore.getSiteSettings()); + }, []); + + if (!settings) return null; + return (
@@ -35,8 +45,7 @@ export default function Contact() {

ADRES

- Emniyet Mah. Hipodrom Caddesi No: 5
- Yenimahalle / Ankara + {settings.contact.address}

@@ -53,10 +62,10 @@ export default function Contact() {
@@ -73,10 +82,10 @@ export default function Contact() {
diff --git a/app/medya/page.tsx b/app/medya/page.tsx index 23adb7a..4cac2bf 100644 --- a/app/medya/page.tsx +++ b/app/medya/page.tsx @@ -1,86 +1,20 @@ 'use client'; -import { useState } from 'react'; +import { useState, useEffect } from 'react'; import Image from 'next/image'; import Header from "@/components/Header"; import Footer from "@/components/Footer"; +import { dataStore } from '@/lib/dataStore'; +import type { MediaItem } from '@/data/media'; export default function MediaGallery() { + const [mediaItems, setMediaItems] = useState([]); const [selectedTab, setSelectedTab] = useState<'all' | 'video' | 'photo'>('all'); const [selectedMedia, setSelectedMedia] = useState(null); - 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ı' - }, - ]; + useEffect(() => { + setMediaItems(dataStore.getMedia()); + }, []); const filteredMedia = selectedTab === 'all' ? mediaItems diff --git a/app/page-new.tsx b/app/page-new.tsx deleted file mode 100644 index b590021..0000000 --- a/app/page-new.tsx +++ /dev/null @@ -1,67 +0,0 @@ -'use client'; - -import { useState, useEffect } from 'react'; -import Header from "@/components/Header"; -import Footer from "@/components/Footer"; -import HeroSlider from "@/components/HeroSlider"; -import QuickMenuCards from "@/components/QuickMenuCards"; -import LiveStreamSection from "@/components/LiveStreamSection"; -import NewsSection from "@/components/NewsSection"; -import MetroLine from "@/components/MetroLine"; - -export default function Home() { - const [showLiveStream, setShowLiveStream] = useState(false); - const [showNews, setShowNews] = useState(false); - const [showDocuments, setShowDocuments] = useState(false); - const [showMediaGallery, setShowMediaGallery] = useState(false); - const [showComplaintForm, setShowComplaintForm] = useState(false); - const [showContact, setShowContact] = useState(false); - - // 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]); - - return ( -
-
- - {/* Hero Slider Section */} - - - {/* Quick Menu Cards */} - setShowLiveStream(!showLiveStream)} - onNewsClick={() => setShowNews(!showNews)} - onDocumentsClick={() => setShowDocuments(!showDocuments)} - onMediaClick={() => setShowMediaGallery(!showMediaGallery)} - onComplaintClick={() => setShowComplaintForm(!showComplaintForm)} - onContactClick={() => setShowContact(!showContact)} - /> - - {/* Live Stream Section */} - setShowLiveStream(false)} - /> - - {/* News Section */} - setShowNews(false)} - showLiveStream={showLiveStream} - /> - - {/* Metro Line Section - Ana içerik */} -
-
- -
-
- -
-
- ); -} diff --git a/app/page.tsx b/app/page.tsx index 134396a..68217de 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -25,11 +25,13 @@ export default function Home() { // Gerçek veriler için state const [heroSlides, setHeroSlides] = useState(dataStore.getSlider()); const [newsData, setNewsData] = useState(dataStore.getNews()); + const [liveStreamConfig, setLiveStreamConfig] = useState(dataStore.getLiveStream()); // Verileri yükle useEffect(() => { setHeroSlides(dataStore.getSlider()); setNewsData(dataStore.getNews()); + setLiveStreamConfig(dataStore.getLiveStream()); }, []); // Modal açıldığında yukarı kaydır - KALDIRILDI (kullanıcı deneyimi için) @@ -290,13 +292,13 @@ export default function Home() {
{/* Canlı Yayın Video Bölümü */} - {showLiveStream && ( + {showLiveStream && liveStreamConfig.active && (
-

Canlı Yayın

+

{liveStreamConfig.title || 'Canlı Yayın'}

))} @@ -1289,145 +1308,617 @@ export default function Dashboard() {
)}
- - {/* Features */} -
-

ÖZELLİKLER:

-
- {station.features.map((feature, i) => ( - - {feature} - - ))} -
-
))}
- - {/* Stats */} -
-
-
-
-

Toplam İstasyon

-

{metroStations.length}

-
-
🚇
-
-
-
-
-
-

Tamamlanan

-

{metroStations.filter(s => s.status === 'completed').length}

-
-
-
-
-
-
-
-

Devam Eden

-

{metroStations.filter(s => s.status === 'in-progress').length}

-
-
🔄
-
-
-
-
-
-

Planlanan

-

{metroStations.filter(s => s.status === 'planned').length}

-
-
📅
-
-
-
)} - {/* Settings Section */} - {activeSection === 'settings' && ( + {/* Live Stream Management Section */} + {activeSection === 'live-stream' && liveStreamConfig && (
-

Sistem Ayarları

- -
- {/* Site Settings */} -
-

- 🌐 - Site Ayarları -

-
-
- - -
-
- - -
-
+
+

Canlı Yayın Yönetimi

+

YouTube canlı yayın URL'sini ve ayarlarını yönetin

+
+ +
{ + e.preventDefault(); + dataStore.setLiveStream(liveStreamConfig); + alert('Canlı yayın ayarları kaydedildi!'); + }} className="space-y-6"> +
+
- {/* Admin Settings */} -
-

- 👤 - Admin Ayarları -

-
-
- - -
-
- - -
-
+
+ + setLiveStreamConfig({ ...liveStreamConfig, title: 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" + placeholder="Canlı Yayın" + />
- {/* Notification Settings */} -
-

- 🔔 - Bildirim Ayarları -

-
- - - -
+
+ + setLiveStreamConfig({ ...liveStreamConfig, url: 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" + placeholder="https://www.youtube.com/embed/VIDEO_ID" + required + /> +

+ YouTube video URL'sini embed formatında girin. Örnek: https://www.youtube.com/embed/VIDEO_ID +

- {/* Save Button */} -
- -
-
+
)} - {activeSection !== 'overview' && activeSection !== 'slider' && activeSection !== 'news' && activeSection !== 'media' && activeSection !== 'documents' && activeSection !== 'metro-line' && activeSection !== 'settings' && ( + {/* Messages Section */} + {activeSection === 'messages' && ( +
+
+
+
+

Gelen Mesajlar

+

Kullanıcılardan gelen dilek, öneri ve şikayetler

+
+
+ + {messages.filter(m => !m.read).length} Okunmamış + +
+
+ + {messages.length === 0 ? ( +
+ + + +

Henüz mesaj bulunmuyor

+
+ ) : ( +
+ {messages.map((message) => ( +
+
+
+
+

{message.name}

+ + {message.type === 'sikayet' ? 'Şikayet' : message.type === 'oneri' ? 'Öneri' : 'Bilgi Talebi'} + + {!message.read && ( + Yeni + )} +
+

+ 📧 {message.email} • 📱 {message.phone} +

+

+ Konu: {message.subject} +

+

+ {message.message} +

+

+ {new Date(message.date).toLocaleString('tr-TR')} +

+
+
+
+ {!message.read && ( + + )} + +
+
+ ))} +
+ )} +
+
+ )} + + {/* FAQs Section */} + {activeSection === 'faqs' && ( +
+
+
+

SSS Yönetimi

+ +
+ +
+ {faqs.map((faq) => ( +
+
+
+
+ + { + dataStore.updateFAQ(faq.id, { question: e.target.value }); + loadData(); + }} + className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#00B4D8] focus:border-transparent" + /> +
+
+ { + dataStore.updateFAQ(faq.id, { order: parseInt(e.target.value) }); + loadData(); + }} + className="w-16 px-2 py-2 border border-gray-300 rounded-lg text-center" + title="Sıra" + /> + +
+
+
+ +