import React, { useState, useRef } from 'react'; import { Camera, Building, Recycle, DollarSign, Truck, MapPin, Search, Filter } from 'lucide-react'; const DigitalQuarry = () => { const [selectedImage, setSelectedImage] = useState(null); const [analysis, setAnalysis] = useState(null); const [loading, setLoading] = useState(false); const [userType, setUserType] = useState('demolition'); const [marketplace, setMarketplace] = useState([]); const [dragActive, setDragActive] = useState(false); const fileInputRef = useRef(null); const handleImageUpload = (event) => { const file = event.target.files[0]; if (file) { const reader = new FileReader(); reader.onload = (e) => { setSelectedImage(e.target.result); analyzeBuildingMaterials(file); }; reader.readAsDataURL(file); } }; const analyzeBuildingMaterials = async (imageFile) => { setLoading(true); // Simulate AI analysis of building materials setTimeout(async () => { const mockAnalysis = { buildingType: 'Commercial Office Building', totalValue: 485000, co2Savings: 1250, // tons CO2 saved vs new materials materials: [ { type: 'Structural Steel I-Beams', quantity: '45 units (30-foot)', grade: 'A992 Grade 50', condition: 'Excellent', estimatedValue: 125000, weight: '18,500 lbs', co2Savings: 425, // tons applications: ['High-rise construction', 'Industrial buildings', 'Bridges'] }, { type: 'Concrete Slabs', quantity: '2,400 sq ft', grade: '4000 PSI', condition: 'Good', estimatedValue: 85000, weight: '240,000 lbs', co2Savings: 380, applications: ['Foundation work', 'Parking structures', 'Flooring'] }, { type: 'Hardwood Flooring', quantity: '3,200 sq ft', grade: 'Red Oak Premium', condition: 'Very Good', estimatedValue: 95000, weight: '8,000 lbs', co2Savings: 125, applications: ['Residential flooring', 'Commercial spaces', 'Furniture'] }, { type: 'Copper Wiring', quantity: '2,800 linear feet', grade: '12 AWG THHN', condition: 'Excellent', estimatedValue: 45000, weight: '850 lbs', co2Savings: 85, applications: ['Electrical systems', 'HVAC', 'Telecommunications'] }, { type: 'Aluminum Windows', quantity: '28 units', grade: 'Double-pane Low-E', condition: 'Good', estimatedValue: 65000, weight: '1,200 lbs', co2Savings: 95, applications: ['Residential construction', 'Office buildings', 'Renovations'] }, { type: 'Brick Facade', quantity: '8,500 bricks', grade: 'Clay Common Brick', condition: 'Excellent', estimatedValue: 35000, weight: '42,500 lbs', co2Savings: 140, applications: ['Exterior walls', 'Landscaping', 'Decorative features'] } ], logistics: { demolitionDate: '2024-03-15', location: 'Downtown Seattle, WA', accessibility: 'Good - Street level access', storageRequired: '2 weeks', transportationCost: 12000 }, marketDemand: { steel: 'High - 15 active buyers within 50 miles', concrete: 'Medium - 8 active buyers', hardwood: 'Very High - 22 active buyers', copper: 'Critical - 31 active buyers', aluminum: 'High - 18 active buyers', brick: 'Medium - 12 active buyers' } }; setAnalysis(mockAnalysis); // Log activity for dashboard try { const { authManager } = await import('../utils/auth'); await authManager.logActivity('Building materials analyzed', { buildingType: mockAnalysis.buildingType, totalValue: mockAnalysis.totalValue, co2Savings: mockAnalysis.co2Savings, materialsCount: mockAnalysis.materials.length }); } catch (error) { console.warn('Failed to log activity:', error); } setLoading(false); }, 3000); }; const handleDrop = (e) => { e.preventDefault(); e.stopPropagation(); setDragActive(false); const files = e.dataTransfer.files; if (files && files[0]) { const file = files[0]; if (file.type.startsWith('image/')) { const reader = new FileReader(); reader.onload = (e) => { setSelectedImage(e.target.result); analyzeBuildingMaterials(file); }; reader.readAsDataURL(file); } else { alert('Please upload an image file'); } } }; const handleDragOver = (e) => { e.preventDefault(); e.stopPropagation(); setDragActive(true); }; const handleDragLeave = (e) => { e.preventDefault(); e.stopPropagation(); setDragActive(false); }; const getConditionColor = (condition) => { switch (condition) { case 'Excellent': return '#4CAF50'; case 'Very Good': return '#8BC34A'; case 'Good': return '#FF9800'; case 'Fair': return '#FF5722'; default: return '#666'; } }; const getDemandColor = (demand) => { if (!demand || typeof demand !== 'string') return '#4CAF50'; if (demand.includes('Critical')) return '#f44336'; if (demand.includes('Very High')) return '#FF5722'; if (demand.includes('High')) return '#FF9800'; return '#4CAF50'; }; return (
AI-powered platform turning demolition waste into construction gold
This tool uses simulated data for demonstration purposes.
All building analysis, material valuations, and marketplace data are generated examples. Production version would integrate with real LiDAR equipment and live commodity markets.
Construction waste accounts for 40% of global solid waste, while new material production generates 15% of global CO₂ emissions. Perfectly good steel beams, concrete, and fixtures are crushed and landfilled while new buildings demand fresh materials.
Transform every demolition site into a digital quarry. Our AI scans buildings before demolition, identifies and grades every reusable material, then connects supply with demand through a real-time B2B marketplace.
LiDAR/photo analysis of structure
Identify, grade, and value materials
Match supply with construction demand
Coordinate pickup and delivery
{dragActive ? 'Drop building photos here!' : 'Drag & drop building photos or LiDAR scans'}
For best results: Multiple angles, interior/exterior, structural elements visible
🤖 Analyzing building materials with AI...
Identifying structural elements, grading condition, calculating value...
{material.quantity} • {material.grade}
Estimated total interest: 89 potential buyers within 50 miles
Construction marketplace coming soon!
Browse reclaimed materials from demolition sites in your area
Architect tools coming soon!
Design sustainable buildings with available reclaimed materials