import React, { useState } from 'react'; import { ChevronRight, Tool, AlertCircle, CheckCircle, Phone } from 'lucide-react'; export default function ApplianceDiagnostic() { const [step, setStep] = useState('appliance'); // appliance, symptoms, results, contact const [selectedAppliance, setSelectedAppliance] = useState(null); const [selectedSymptoms, setSelectedSymptoms] = useState([]); const [contactInfo, setContactInfo] = useState({ name: '', phone: '', email: '' }); const [submitted, setSubmitted] = useState(false); const appliances = [ { id: 'refrigerator', name: 'Refrigerator', icon: '❄️' }, { id: 'dishwasher', name: 'Dishwasher', icon: '🍽️' }, { id: 'washer', name: 'Washing Machine', icon: '🌊' }, { id: 'dryer', name: 'Dryer', icon: '🔥' }, { id: 'oven', name: 'Oven/Range', icon: '🍳' }, { id: 'microwave', name: 'Microwave', icon: '📡' }, ]; const symptoms = { refrigerator: [ { symptom: 'Not cooling properly', issue: 'Compressor or thermostat may be faulty', severity: 'high' }, { symptom: 'Leaking water inside', issue: 'Clogged drain line or defrost issue', severity: 'high' }, { symptom: 'Making strange noises', issue: 'Fan or compressor bearing wear', severity: 'medium' }, { symptom: 'Ice buildup in freezer', issue: 'Door seal issue or defrost system problem', severity: 'medium' }, { symptom: 'Not starting/no power', issue: 'Power supply or control board failure', severity: 'high' }, ], dishwasher: [ { symptom: 'Not draining water', issue: 'Clogged drain or pump failure', severity: 'high' }, { symptom: 'Dishes still dirty after cycle', issue: 'Spray arm blockage or pump issue', severity: 'medium' }, { symptom: 'Leaking water', issue: 'Door seal worn or pump seal failure', severity: 'high' }, { symptom: 'Not starting', issue: 'Control board or door latch issue', severity: 'high' }, { symptom: 'Strange odors', issue: 'Food debris or mold in filter', severity: 'low' }, ], washer: [ { symptom: 'Not draining', issue: 'Clogged drain hose or pump failure', severity: 'high' }, { symptom: 'Leaking water', issue: 'Hose connection loose or seal worn', severity: 'high' }, { symptom: 'Making loud noise during spin', issue: 'Drum bearing or foreign object', severity: 'high' }, { symptom: 'Not spinning/clothes soaking wet', issue: 'Motor or belt issue', severity: 'high' }, { symptom: 'Won\'t fill with water', issue: 'Inlet valve or water supply issue', severity: 'medium' }, ], dryer: [ { symptom: 'Not heating', issue: 'Heating element or thermal fuse failure', severity: 'high' }, { symptom: 'Taking too long to dry', issue: 'Clogged vent or airflow issue', severity: 'medium' }, { symptom: 'Not tumbling', issue: 'Belt or pulley failure', severity: 'high' }, { symptom: 'Making squeaking noise', issue: 'Drum roller or idler wear', severity: 'medium' }, { symptom: 'Not starting', issue: 'Door latch or thermal fuse blown', severity: 'high' }, ], oven: [ { symptom: 'Not heating', issue: 'Heating element or ignitor failure', severity: 'high' }, { symptom: 'Temperature not accurate', issue: 'Thermostat or sensor issue', severity: 'medium' }, { symptom: 'Door won\'t close properly', issue: 'Door hinge or latch broken', severity: 'medium' }, { symptom: 'Self-cleaning not working', issue: 'Latch or control board issue', severity: 'low' }, { symptom: 'Smoking or burning smells', issue: 'Food debris or heating element issue', severity: 'high' }, ], microwave: [ { symptom: 'Not heating food', issue: 'Magnetron failure or high voltage issue', severity: 'high' }, { symptom: 'Not turning on', issue: 'Power supply or control board failure', severity: 'high' }, { symptom: 'Sparking inside', issue: 'Metal in microwave or waveguide damage', severity: 'high' }, { symptom: 'Display not working', issue: 'Control board failure', severity: 'medium' }, { symptom: 'Making weird noises', issue: 'Turntable motor or fan issue', severity: 'low' }, ], }; const handleApplianceSelect = (applianceId) => { setSelectedAppliance(applianceId); setSelectedSymptoms([]); setStep('symptoms'); }; const handleSymptomToggle = (symptomIndex) => { setSelectedSymptoms(prev => prev.includes(symptomIndex) ? prev.filter(i => i !== symptomIndex) : [...prev, symptomIndex] ); }; const handleGetResults = () => { if (selectedSymptoms.length > 0) { setStep('results'); } }; const handleContactSubmit = (e) => { e.preventDefault(); if (contactInfo.name && contactInfo.phone) { setSubmitted(true); // In a real scenario, you'd send this to your server/email console.log('Contact submitted:', contactInfo); } }; const getSeverityColor = (severity) => { switch (severity) { case 'high': return 'text-red-600 bg-red-50'; case 'medium': return 'text-yellow-600 bg-yellow-50'; case 'low': return 'text-green-600 bg-green-50'; default: return 'text-gray-600 bg-gray-50'; } }; const selectedApplianceName = appliances.find(a => a.id === selectedAppliance)?.name; const appliance = symptoms[selectedAppliance]; return (
{/* Header */}

Appliance Diagnostic

Jupiter Appliance Repair - Quick Problem Identification

{/* Step 1: Select Appliance */} {step === 'appliance' && (

What appliance needs repair?

{appliances.map(app => ( ))}
)} {/* Step 2: Select Symptoms */} {step === 'symptoms' && (

Select symptoms for your {selectedApplianceName}

{appliance.map((item, idx) => ( ))}
)} {/* Step 3: Results */} {step === 'results' && (

Diagnostic Results

{/* Selected symptoms with analysis */}
{selectedSymptoms.map(idx => { const item = appliance[idx]; return (
{item.severity === 'high' ? ( ) : ( )}

{item.symptom}

⚙️ Likely cause: {item.issue}

{item.severity === 'high' && '🔴 Requires professional service'} {item.severity === 'medium' && '🟡 Should be serviced soon'} {item.severity === 'low' && '🟢 May be fixable easily'}

); })}
{/* Recommendation */}

📋 Our Recommendation:

Based on your appliance's symptoms, we recommend scheduling a professional service call. Our Jupiter service team can provide accurate diagnosis and repairs.

)} {/* Step 4: Contact Form */} {step === 'contact' && !submitted && (

Request Service

setContactInfo({ ...contactInfo, name: e.target.value })} className="w-full px-4 py-3 border-2 border-gray-200 rounded-lg focus:border-indigo-500 focus:outline-none" placeholder="Your name" required />
setContactInfo({ ...contactInfo, phone: e.target.value })} className="w-full px-4 py-3 border-2 border-gray-200 rounded-lg focus:border-indigo-500 focus:outline-none" placeholder="(561) 123-4567" required />
setContactInfo({ ...contactInfo, email: e.target.value })} className="w-full px-4 py-3 border-2 border-gray-200 rounded-lg focus:border-indigo-500 focus:outline-none" placeholder="your@email.com" />
)} {/* Submission Confirmation */} {submitted && (

Request Submitted!

Thank you, {contactInfo.name}! We received your service request. Our Jupiter team will contact you at {contactInfo.phone} within 24 hours to schedule your appointment.

)} {/* Footer */}

Jupiter Appliance Repair • Serving the Local Community

⚠️ Emergency repairs available • Free diagnostic consultation

); }

Comments