import React from 'react'; import { AlertTriangle, FileSpreadsheet, FileText } from 'lucide-react'; export default function BoqStep({ currentStep, boqMeta, calculateGrandTotal, boqItems, handlePriceChange, handleQtyChange, handleSaveReview, setCurrentStep, downloadExcel, downloadPDF, onNavigate, isArabic }) { if (currentStep === 6) { return (
{/* Meta Alerts & Warnings */} {(boqMeta.needs_input?.length > 0 || boqMeta.estimates?.length > 0) && (
{boqMeta.needs_input?.length > 0 && (
{isArabic ? 'قيم مفقودة تتطلب مراجعة بشرية:' : 'Missing drawing values (needs verification):'}
    {boqMeta.needs_input.map((item, i) =>
  • {item}
  • )}
)} {boqMeta.estimates?.length > 0 && (
{isArabic ? 'تنبيه: قيم تم تقديرها تلقائياً:' : 'Automatically estimated averages:'}
    {boqMeta.estimates.map((item, i) =>
  • {item}
  • )}
)}
)} {/* BOQ Table Sheet */}

{isArabic ? '6. مراجعة وتعديل الكميات (كل القيم قابلة للتعديل اليدوي)' : '6. Review & Edit Quantities (every value is editable)'}

{boqItems.map((item, idx) => { if (item._is_header) { return ( ); } return ( ); })}
# {isArabic ? 'البيان بالإنجليزية' : 'Description (English)'} {isArabic ? 'البيان بالعربية' : 'البيان (العربية)'} {isArabic ? 'الوحدة' : 'Unit'} {isArabic ? 'الكمية (للتعديل)' : 'Qty (edit)'} {isArabic ? 'السعر (للتعديل)' : 'Price (edit)'} {isArabic ? 'الإجمالي' : 'Total'}
{item["Description (English)"]}
{item["#"]} {item["Description (English)"]} {item["البيان"]} {item["Unit"]} handleQtyChange(idx, e.target.value)} placeholder={item.has_error ? '⚠️ Err' : '0.00'} style={{ width: '100%', padding: '5px', fontSize: '0.9rem', fontWeight: 600, color: item.has_error ? '#ef4444' : 'var(--text-primary)' }} /> handlePriceChange(idx, e.target.value)} placeholder="0.00" style={{ width: '100%', padding: '5px', fontSize: '0.9rem', fontWeight: 600 }} /> {((parseFloat(item["Quantity"]) || 0) * (parseFloat(item["Unit Price"]) || 0)).toFixed(2)}
); } if (currentStep === 8) { return (
✓

{isArabic ? '8. تم حصر كميات المشروع بنجاح!' : '8. Project Quantity Takeoff Completed Successfully!'}

{isArabic ? 'يمكنك الآن تحميل جداول الكميات والتكلفة التفصيلية بصيغة Excel الاحترافية أو تقرير PDF المهندس.' : 'You can now export and download the final itemized BOQ sheets in styled Excel formats or PDF reports.'}

); } return null; }