parass13 commited on
Commit
8cc32da
Β·
verified Β·
1 Parent(s): f2321f5

Create diabetes_factors.py

Browse files
Files changed (1) hide show
  1. components/diabetes_factors.py +65 -0
components/diabetes_factors.py ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ import gradio as gr
4
+
5
+ def render_factors_info():
6
+ """
7
+ Creates and returns the Gradio UI for the 'Factors Affecting Diabetes' content.
8
+ """
9
+ with gr.Blocks() as factors_ui:
10
+ gr.Markdown("## 🩺 Understanding the Factors Behind Diabetes")
11
+ gr.Markdown(
12
+ "Diabetes is a complex condition influenced by a mix of genetic, lifestyle, and environmental factors. "
13
+ "Understanding your personal risk factors is the first step toward prevention and effective management."
14
+ )
15
+ gr.Markdown("---")
16
+
17
+ with gr.Accordion("Type 2 Diabetes: The Most Common Form", open=True):
18
+ gr.Markdown(
19
+ """
20
+ This occurs when your body becomes resistant to insulin or doesn't produce enough.
21
+
22
+ ### Factors You Cannot Change (Non-Modifiable)
23
+ * **🧬 Family History:** A parent or sibling with Type 2 diabetes significantly increases your risk.
24
+ * **πŸ—“οΈ Age:** Risk increases after age 35.
25
+ * **🌍 Race or Ethnicity:** People of certain backgrounds (African American, Hispanic, American Indian, Asian American) are at higher risk.
26
+ * **🀰 History of Gestational Diabetes:** If you had diabetes during a pregnancy, your risk is higher.
27
+
28
+ ### Lifestyle-Related Risk Factors (Modifiable)
29
+ * **βš–οΈ Weight:** Being overweight or having obesity is the single most important risk factor.
30
+ * **πŸƒβ€β™€οΈ Physical Inactivity:** A sedentary lifestyle reduces your body's ability to use insulin.
31
+ * **πŸ” Unhealthy Diet:** High consumption of processed foods, sugar, and unhealthy fats.
32
+ * **🩸 High Blood Pressure & Cholesterol:** These conditions are often linked to insulin resistance.
33
+ * **🚬 Smoking:** This habit increases inflammation and makes it harder for your body to manage blood sugar.
34
+ """
35
+ )
36
+
37
+ with gr.Accordion("Type 1 Diabetes: An Autoimmune Condition", open=False):
38
+ gr.Markdown(
39
+ """
40
+ This type occurs when the body's immune system mistakenly attacks and destroys the insulin-producing cells in the pancreas. The exact triggers are not fully known.
41
+
42
+ ### Key Factors
43
+ * **🧬 Family History:** While not as strong as in Type 2, having a close relative with Type 1 increases risk.
44
+ * **πŸ”¬ Genetics:** Specific genes are known to make individuals more susceptible.
45
+ * **πŸŽ‚ Age:** It is most commonly diagnosed in children, teens, and young adults.
46
+ * **🦠 Environmental Triggers:** It is believed that certain viruses might trigger the autoimmune attack in genetically predisposed individuals.
47
+ """
48
+ )
49
+
50
+ with gr.Accordion("Gestational Diabetes: During Pregnancy", open=False):
51
+ gr.Markdown(
52
+ """
53
+ This type of diabetes develops in some women during pregnancy and usually disappears after birth. However, it increases the risk for both mother and child to develop Type 2 diabetes later in life.
54
+
55
+ ### Key Risk Factors
56
+ * **βš–οΈ Pre-pregnancy Weight:** Being overweight before becoming pregnant.
57
+ * **πŸ—“οΈ Maternal Age:** Being older than 25.
58
+ * **πŸ‘¨β€πŸ‘©β€πŸ‘§ Family History:** A family history of Type 2 diabetes.
59
+ * **🩺 Medical History:** Having had gestational diabetes before or having Polycystic Ovary Syndrome (PCOS).
60
+ """
61
+ )
62
+
63
+ # Note: In a modular setup, you might just build the Markdown/Accordion group
64
+ # and add it to an existing Blocks() instance in app.py.
65
+ # For now, this self-contained block is fine.