'use client'; import { useState, useEffect } from 'react'; import { dataStore } from '@/lib/dataStore'; import type { Document } from '@/data/documents'; interface DocumentCategory { id: string; name: string; icon: string; } interface DocumentsSectionProps { onClose: () => void; } export default function DocumentsSection({ onClose }: DocumentsSectionProps) { const [documents, setDocuments] = useState([]); const [selectedCategory, setSelectedCategory] = useState('all'); const categories: DocumentCategory[] = [ { 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: '🛡️' }, ]; useEffect(() => { setDocuments(dataStore.getDocuments()); }, []); 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 '📊'; case 'DOCX': return '📝'; default: return '📄'; } }; return (

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 */}
))}
); }