Find Tea

 

 

Tea Ailment Finder

Select an ailment to find a tea:

function populateAilments(data) { const select = document.getElementById('ailmentSelect'); const ailments = Object.keys(data).sort(); // Sort alphabetically ailments.forEach(ailment => { const option = document.createElement('option'); option.value = ailment; option.text = ailment; select.appendChild(option); }); }

// Fetch teas when button is clicked function findTeas() { const ailment = document.getElementById('ailmentSelect').value; if (ailment) { google.script.run.withSuccessHandler(displayTeas).getTeasForAilment(ailment); } else { document.getElementById('result').innerHTML = 'Please select an ailment.'; } }

// Display tea results function displayTeas(teas) { const resultDiv = document.getElementById('result'); if (teas.length > 0) { resultDiv.innerHTML = 'Recommended Teas:
' + teas.join('
'); } else { resultDiv.innerHTML = 'No teas found for this ailment.'; } }

bringing awareness to hand-made, sustainable products with our affiliates

Image 5
Image 5
Image 1
Image 2
Image 3
Image 4
Image 6