File size: 3,851 Bytes
102e23b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
'use client';

import { Heart, Brain, Baby, Pill, Bug, Leaf, AlertTriangle, Activity } from 'lucide-react';
import type { SupportedLanguage } from '@/lib/i18n';

interface TopicsViewProps {
  language: SupportedLanguage;
  onSelectTopic: (topic: string) => void;
}

const TOPIC_CATEGORIES = [
  {
    title: 'Cardiovascular',
    icon: Heart,
    color: 'text-red-400',
    bgColor: 'bg-red-950/30',
    topics: ['Heart Attack Symptoms', 'High Blood Pressure', 'Stroke Signs (FAST)', 'Cholesterol', 'Chest Pain'],
  },
  {
    title: 'Chronic Diseases',
    icon: Activity,
    color: 'text-blue-400',
    bgColor: 'bg-blue-950/30',
    topics: ['Type 2 Diabetes', 'Asthma Management', 'COPD', 'Kidney Disease', 'Obesity'],
  },
  {
    title: 'Mental Health',
    icon: Brain,
    color: 'text-purple-400',
    bgColor: 'bg-purple-950/30',
    topics: ['Depression', 'Anxiety', 'Stress Management', 'Sleep Problems', 'Grief and Loss'],
  },
  {
    title: 'Maternal & Child',
    icon: Baby,
    color: 'text-pink-400',
    bgColor: 'bg-pink-950/30',
    topics: ['Pregnancy Care', 'Child Fever', 'Breastfeeding', 'Vaccination Schedule', 'ORS for Diarrhea'],
  },
  {
    title: 'Infectious Diseases',
    icon: Bug,
    color: 'text-yellow-400',
    bgColor: 'bg-yellow-950/30',
    topics: ['Malaria', 'Tuberculosis', 'HIV/AIDS', 'Dengue Fever', 'COVID-19'],
  },
  {
    title: 'Medication Safety',
    icon: Pill,
    color: 'text-green-400',
    bgColor: 'bg-green-950/30',
    topics: ['Antibiotic Misuse', 'Pain Medication', 'Drug Interactions', 'When to See a Doctor', 'First Aid Basics'],
  },
  {
    title: 'Nutrition',
    icon: Leaf,
    color: 'text-emerald-400',
    bgColor: 'bg-emerald-950/30',
    topics: ['Iron Deficiency', 'Vitamin D', 'Healthy Diet', 'Malnutrition Signs', 'Hydration'],
  },
  {
    title: 'Emergency Signs',
    icon: AlertTriangle,
    color: 'text-red-400',
    bgColor: 'bg-red-950/30',
    topics: ['When to Call Emergency', 'Choking First Aid', 'Burns Treatment', 'Snakebite First Aid', 'Allergic Reaction'],
  },
];

export default function TopicsView({ onSelectTopic }: TopicsViewProps) {
  return (
    <div className="flex-1 overflow-y-auto scroll-smooth">
      {/* Header */}
      <div className="px-4 py-4 border-b border-slate-700/50">
        <h2 className="text-lg font-bold text-slate-100">Health Topics</h2>
        <p className="text-sm text-slate-400 mt-1">
          Browse by category or tap a topic to ask
        </p>
      </div>

      {/* Topic Categories */}
      <div className="p-4 space-y-4">
        {TOPIC_CATEGORIES.map((category) => {
          const Icon = category.icon;
          return (
            <div
              key={category.title}
              className={`rounded-xl ${category.bgColor} border border-slate-700/20 p-4`}
            >
              <div className="flex items-center gap-2 mb-3">
                <Icon size={18} className={category.color} />
                <h3 className="text-sm font-semibold text-slate-200">
                  {category.title}
                </h3>
              </div>
              <div className="flex flex-wrap gap-2">
                {category.topics.map((topic) => (
                  <button
                    key={topic}
                    onClick={() =>
                      onSelectTopic(`Tell me about ${topic.toLowerCase()}`)
                    }
                    className="px-3 py-1.5 rounded-full bg-slate-800/60 border border-slate-700/30
                               text-xs text-slate-300 hover:bg-slate-700 hover:text-slate-100
                               transition-all touch-target active:scale-95"
                  >
                    {topic}
                  </button>
                ))}
              </div>
            </div>
          );
        })}
      </div>
    </div>
  );
}