var _useState = React.useState;

/**
 * TipOfTheWeek — Displays a random mould education tip from a curated list.
 * Tip is selected once per component mount (stable within a session).
 * Categories: health, detection, prevention, cleaning, professional
 */

var MOULD_TIPS = [
    // --- What is Mould: Health Risks ---
    { category: 'Health Risk', icon: 'health_and_safety', text: 'Stachybotrys chartarum (Black Mould) needs sustained wetness to grow, so finding it is a reliable sign of a real water problem. That, rather than the colour, is what makes it worth acting on. Fix the moisture source first.' },
    { category: 'Health Risk', icon: 'health_and_safety', text: 'Aspergillus is a common greenish household fungus that produces mycotoxins, leading to respiratory infections and aspergillosis in people with weakened immune systems.' },
    { category: 'Health Risk', icon: 'health_and_safety', text: 'Cladosporium grows in both cool and warm environments on textiles, wood, and insulation. It causes significant allergic reactions including wheezing, skin rashes, and asthma.' },
    { category: 'Health Risk', icon: 'health_and_safety', text: 'Penicillium grows within 24\u201348 hours in high humidity on water-damaged materials. It can cause allergies, chronic sinusitis, and other respiratory illnesses.' },
    { category: 'Health Risk', icon: 'health_and_safety', text: 'Fusarium is found in damp, water-damaged carpet and materials. It can cause skin lesions and infections, often spreading rapidly throughout a house.' },
    { category: 'Health Risk', icon: 'health_and_safety', text: 'Around 5 types of mould have serious human health implications. Early detection and remediation is critical to protecting your family.' },

    // --- Detecting Mould ---
    { category: 'Detection', icon: 'search', text: 'Coughing, wheezing, and asthma attacks can be signs of mould exposure. Symptoms often mimic allergies or flu-like illness.' },
    { category: 'Detection', icon: 'search', text: 'Eye, skin, nose, and throat irritation that persists indoors may indicate hidden mould growth. Check damp-prone areas like bathrooms and basements.' },
    { category: 'Detection', icon: 'search', text: 'A persistent musty smell is one of the earliest indicators of mould, even when it\u2019s not visible. Follow your nose to find the source.' },

    // --- Preventing Mould Growth ---
    { category: 'Prevention', icon: 'shield', text: 'Open windows daily and use exhaust fans in the bathroom, kitchen, and laundry to prevent steam buildup and improve ventilation.' },
    { category: 'Prevention', icon: 'shield', text: 'Immediately fix plumbing leaks, roof leaks, and gutter issues. Moisture control is the single most effective way to prevent mould.' },
    { category: 'Prevention', icon: 'shield', text: 'Keeping indoor humidity below 50% is the most effective natural way to prevent new mould growth. Consider using a dehumidifier.' },
    { category: 'Prevention', icon: 'shield', text: 'Reduce indoor humidity by limiting portable humidifiers, reducing indoor plants, and avoiding drying clothes indoors.' },
    { category: 'Prevention', icon: 'shield', text: 'Keep furniture slightly away from walls to allow air circulation, especially in wardrobes and behind large items.' },
    { category: 'Prevention', icon: 'shield', text: 'Wipe down shower screens, walls, and windowsills where condensation collects. Regular wiping prevents mould from establishing.' },

    // --- Cleaning and Removing Mould ---
    { category: 'Cleaning', icon: 'cleaning_services', text: 'Safety first: wear a P2 respirator mask, rubber gloves, and safety glasses when cleaning mould. Spores are harmful when inhaled.' },
    { category: 'Cleaning', icon: 'cleaning_services', text: 'Clean hard surfaces with white vinegar diluted 3 parts vinegar to 1 part water. It\u2019s a natural, non-toxic solution that kills most mould species.' },
    { category: 'Cleaning', icon: 'cleaning_services', text: 'Never dry brush or vacuum dry mould \u2014 this spreads spores into the air. Always use damp cloths or microfibre to trap spores.' },
    { category: 'Cleaning', icon: 'cleaning_services', text: 'Porous items like cushions, mattresses, and carpets that are heavily contaminated often cannot be cleaned and should be disposed of.' },
    { category: 'Cleaning', icon: 'cleaning_services', text: 'For small areas (less than 1m\u00B2), clean using damp cloths or microfibre to trap spores. Work from the outside in to contain the area.' },

    // --- When to Call a Professional ---
    { category: 'Professional', icon: 'engineering', text: 'Call a professional if mould covers more than 1m\u00B2. Large areas require specialist equipment and containment to prevent spore spread.' },
    { category: 'Professional', icon: 'engineering', text: 'If mould returns quickly after cleaning, it indicates an underlying issue like structural dampness. A professional can identify and fix the root cause.' },
];

var TipOfTheWeek = function () {
    // Select a random tip once on mount (stable for the session)
    var tipState = _useState(function () {
        return MOULD_TIPS[Math.floor(Math.random() * MOULD_TIPS.length)];
    });
    var tip = tipState[0];

    return (
        <section className="bg-terracotta/50 border-2 border-dashed border-terracotta/40 mt-4 p-8 rounded-2xl flex gap-6 items-center">
            <div className="w-16 h-16 shrink-0 bg-terracotta rounded-2xl flex items-center justify-center text-white shadow-lg">
                <span className="material-symbols-outlined text-3xl">{tip.icon}</span>
            </div>
            <div>
                <div className="flex items-center gap-2 mb-1">
                    <h4 className="font-black text-white text-sm uppercase tracking-tight">Did you know?</h4>
                    <span className="text-[9px] font-bold text-forest uppercase tracking-wider">{tip.category}</span>
                </div>
                <p className="text-xs leading-relaxed text-white font-medium italic">{tip.text}</p>
            </div>
        </section>
    );
};

window.TipOfTheWeek = TipOfTheWeek;
