Create food_suggestions.py
Browse files
components/food_suggestions.py
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
|
| 3 |
+
import gradio as gr
|
| 4 |
+
|
| 5 |
+
def render_food_guide():
|
| 6 |
+
"""
|
| 7 |
+
Creates and returns the Gradio UI for the 'Healthy Eating Guide'.
|
| 8 |
+
"""
|
| 9 |
+
with gr.Blocks() as food_ui:
|
| 10 |
+
gr.Markdown("## 🥗 Healthy Eating Guide for Diabetes Management")
|
| 11 |
+
gr.Markdown(
|
| 12 |
+
"A healthy diet is one of the most powerful tools for managing and preventing diabetes. "
|
| 13 |
+
"Focus on whole, nutrient-dense foods."
|
| 14 |
+
)
|
| 15 |
+
gr.Markdown("---")
|
| 16 |
+
|
| 17 |
+
with gr.Row():
|
| 18 |
+
with gr.Column(scale=2):
|
| 19 |
+
gr.Markdown("### Foods to Embrace 🍏")
|
| 20 |
+
gr.Markdown(
|
| 21 |
+
"""
|
| 22 |
+
* **🥬 Leafy Greens:** Spinach, kale, and collards are low in calories and carbohydrates but high in vitamins and minerals.
|
| 23 |
+
* **🍓 Berries:** Strawberries, blueberries, and raspberries are packed with antioxidants, vitamins, and fiber.
|
| 24 |
+
* **🐟 Fatty Fish:** Salmon, sardines, and mackerel are excellent sources of omega-3 fatty acids, which are great for heart health.
|
| 25 |
+
* **🥜 Nuts & Seeds:** Almonds, walnuts, and chia seeds provide healthy fats, fiber, and protein.
|
| 26 |
+
* **🌾 Whole Grains:** Quinoa, oats, and brown rice are better than refined grains as they have less impact on blood sugar.
|
| 27 |
+
* **豆 Legumes:** Beans, lentils, and chickpeas are high in fiber and protein, helping you feel full and stabilizing blood sugar.
|
| 28 |
+
"""
|
| 29 |
+
)
|
| 30 |
+
with gr.Column(scale=1):
|
| 31 |
+
gr.Markdown("### Foods to Limit 🍔")
|
| 32 |
+
gr.Markdown(
|
| 33 |
+
"""
|
| 34 |
+
* **🥤 Sugary Drinks:** Soda, sweetened teas, and fruit juices.
|
| 35 |
+
* **🍞 White Bread & Pasta:** These are refined carbs that can spike blood sugar.
|
| 36 |
+
* **🍟 Fried Foods:** Often high in unhealthy fats and calories.
|
| 37 |
+
* **🍰 Packaged Sweets:** Cakes, cookies, and pastries are high in sugar and unhealthy fats.
|
| 38 |
+
* **🥩 Processed Meats:** Sausages and bacon can be high in sodium and unhealthy fats.
|
| 39 |
+
"""
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
gr.Markdown("---")
|
| 43 |
+
gr.Markdown(
|
| 44 |
+
"💡 **Pro Tip:** Portion control is key! Use smaller plates and be mindful of serving sizes. "
|
| 45 |
+
"For personalized advice, always consult with a registered dietitian or your healthcare provider."
|
| 46 |
+
)
|