feat: İhaleist - Akıllı İhale Takip ve Analiz Platformu (Full PRD + 7 Enterprise Modül)

This commit is contained in:
2026-08-07 16:30:24 +03:00
commit ece74feefe
35 changed files with 7820 additions and 0 deletions
+130
View File
@@ -0,0 +1,130 @@
import React, { useState } from 'react';
import { ResponsiveContainer, LineChart, Line, XAxis, YAxis, Tooltip, CartesianGrid } from 'recharts';
import { TrendingUp, Search, Download, Sparkles, AlertCircle } from 'lucide-react';
import confetti from 'canvas-confetti';
export const PriceAnalysis = () => {
const [selectedProduct, setSelectedProduct] = useState('35*50 TUVAL');
const priceHistoryData = [
{ month: 'Ocak 2026', minFiyat: 110, ortFiyat: 125, maksFiyat: 140 },
{ month: 'Şubat 2026', minFiyat: 115, ortFiyat: 130, maksFiyat: 145 },
{ month: 'Mart 2026', minFiyat: 120, ortFiyat: 135, maksFiyat: 155 },
{ month: 'Nisan 2026', minFiyat: 125, ortFiyat: 140, maksFiyat: 160 },
{ month: 'Mayıs 2026', minFiyat: 130, ortFiyat: 145, maksFiyat: 170 },
{ month: 'Haziran 2026', minFiyat: 135, ortFiyat: 150, maksFiyat: 180 },
{ month: 'Temmuz 2026', minFiyat: 140, ortFiyat: 155, maksFiyat: 185 },
{ month: 'Ağustos 2026', minFiyat: 145, ortFiyat: 160, maksFiyat: 190 }
];
const productsList = [
'35*50 TUVAL',
'50*70 TUVAL',
'1 Gözlü Yemek Kabı',
'Kablosuz Panik Butonu',
'G4 Panel Filtre',
'Çamaşır Suyu 20 L',
'Revizyon Kalça Protez Femoral Stem'
];
const handleDownloadReport = () => {
confetti({ particleCount: 70 });
alert(`${selectedProduct} Fiyat Trend Analizi Raporu (PDF/CSV) İndirildi.`);
};
return (
<div className="space-y-4 my-4 animate-fade-in">
{/* Top Banner */}
<div className="bg-white rounded-xl border border-slate-200 p-5 shadow-xs flex flex-col md:flex-row items-center justify-between gap-4">
<div className="flex items-center gap-3">
<div className="w-10 h-10 rounded-xl bg-emerald-600 text-white flex items-center justify-center shadow-md">
<TrendingUp className="w-6 h-6" />
</div>
<div>
<h1 className="text-xl font-black text-slate-900">Birim Fiyat Analizi & Trend Grafikleri</h1>
<p className="text-xs text-slate-500">Ürün bazında geçmiş ihalelerdeki birim fiyat trendini ve ortalama teklif marjlarını inceleyin.</p>
</div>
</div>
<button
onClick={handleDownloadReport}
className="bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-xs px-4 py-2 rounded-lg flex items-center gap-2 shadow-xs shrink-0"
>
<Download className="w-4 h-4" /> Rapor İndir (PDF/CSV)
</button>
</div>
{/* Main Grid */}
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
{/* Left Column: Product Selector */}
<div className="bg-white rounded-xl border border-slate-200 p-5 shadow-xs space-y-4 h-fit">
<h3 className="font-bold text-xs uppercase tracking-wider text-slate-800 border-b border-slate-100 pb-2">
Ürün / Malzeme Seçimi
</h3>
<div className="space-y-1.5">
{productsList.map(prod => (
<button
key={prod}
onClick={() => setSelectedProduct(prod)}
className={`w-full text-left p-3 rounded-lg text-xs font-semibold transition-all ${
selectedProduct === prod
? 'bg-emerald-600 text-white shadow-xs'
: 'bg-slate-50 hover:bg-slate-100 text-slate-700 border border-slate-200'
}`}
>
📦 {prod}
</button>
))}
</div>
</div>
{/* Right 2 Columns: Recharts Chart & AI Assistant */}
<div className="lg:col-span-2 space-y-6">
{/* Recharts Line Chart */}
<div className="bg-white rounded-xl border border-slate-200 p-5 shadow-xs space-y-4">
<div className="flex items-center justify-between">
<h3 className="font-bold text-sm text-slate-900">
{selectedProduct} — 8 Aylık Birim Fiyat Değişim Grafiği (TL)
</h3>
<span className="text-[10px] bg-emerald-100 text-emerald-800 font-extrabold px-2 py-0.5 rounded-full">
Canlı EKAP Verisi
</span>
</div>
<div className="h-72 w-full pt-2">
<ResponsiveContainer width="100%" height="100%">
<LineChart data={priceHistoryData}>
<CartesianGrid strokeDasharray="3 3" stroke="#f1f5f9" />
<XAxis dataKey="month" tick={{ fontSize: 11 }} />
<YAxis tick={{ fontSize: 11 }} />
<Tooltip />
<Line type="monotone" dataKey="ortFiyat" stroke="#059669" strokeWidth={3} name="Ortalama Fiyat" />
<Line type="monotone" dataKey="minFiyat" stroke="#2563eb" strokeWidth={2} strokeDasharray="5 5" name="En Düşük Fiyat" />
<Line type="monotone" dataKey="maksFiyat" stroke="#dc2626" strokeWidth={2} strokeDasharray="5 5" name="En Yüksek Fiyat" />
</LineChart>
</ResponsiveContainer>
</div>
</div>
{/* AI Pricing Advice Box */}
<div className="bg-linear-to-r from-slate-900 to-emerald-950 text-white p-5 rounded-xl space-y-3 shadow-md border border-emerald-900/40">
<div className="flex items-center gap-2 font-bold text-sm text-emerald-400">
<Sparkles className="w-5 h-5 text-amber-400" />
<span>Yapay Zeka Teklif Öneri Motoru</span>
</div>
<p className="text-xs text-slate-300 leading-relaxed">
<strong>{selectedProduct}</strong> için son 8 aydaki ihale kazanma verilerine göre optimal teklif birim fiyatınız: <strong className="text-amber-300 text-sm">₺155 - ₺165</strong> aralığıdır. Bu aralıkta kazanma olasılığınız <strong>%88</strong> olarak hesaplanmıştır.
</p>
</div>
</div>
</div>
</div>
);
};