Skip to content

Commit aa3361e

Browse files
authored
Merge pull request #30 from akshay0611/fix/linterrors
refactor(app): Remove unused imports and clean up component structure
2 parents 6edc1f3 + 3ae2b34 commit aa3361e

File tree

20 files changed

+195
-255
lines changed

20 files changed

+195
-255
lines changed

package-lock.json

Lines changed: 149 additions & 188 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import Home from "./pages/Home";
1414
import SymptomChecker from "./pages/SymptomChecker";
1515
import Doctors from "./pages/Doctors";
1616
import Appointment from "./pages/Appointment";
17-
import Dashboard from "./pages/Dashboard";
1817
import Hospitals from "./pages/Hospitals";
1918
import Faq from "./pages/FAQ";
2019
import Contact from "./pages/Contact";

src/components/HistoryPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const HistoryPanel: React.FC<HistoryPanelProps> = ({ onClose, onSelect, isOpen }
5050
try {
5151
const date = new Date(dateString);
5252
return format(date, 'MMM d, yyyy h:mm a');
53-
} catch (error) {
53+
} catch {
5454
return 'Invalid date';
5555
}
5656
};

src/components/appointment/AppointmentCalendar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ const AppointmentCalendar: React.FC<AppointmentCalendarProps> = ({
125125
{/* Calendar Section */}
126126
<div className="calendar-container">
127127
<Calendar
128-
onChange={handleDateSelect as any}
128+
onChange={handleDateSelect as (value: Date) => void}
129129
value={selectedDate}
130130
tileContent={({ date, view }) => (
131131
<span title={isDateAvailable(date) ? 'Available' : 'Unavailable'}>

src/components/home/Hero.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const Hero: React.FC = () => {
5050
}, 2000);
5151

5252
return () => clearInterval(timer);
53-
}, []);
53+
}, [titles.length]);
5454

5555
const animations = useMemo(() => {
5656
return {

src/components/profile/DoctorProfileForm.tsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import React, { useState, useEffect } from 'react';
2-
import { motion } from 'framer-motion';
32
import toast from 'react-hot-toast';
4-
import { ShieldCheckIcon } from '@heroicons/react/24/outline';
53
import { useAuth } from '../../context/AuthContext';
64
import { supabase } from '../../services/supabaseClient';
75

@@ -60,22 +58,6 @@ export default function DoctorProfileForm(): JSX.Element {
6058
setDoctorProfile(prev => (prev ? { ...prev, [field]: value.split(',').map(item => item.trim()) } : null));
6159
};
6260

63-
const handleSaveProfile = async () => {
64-
if (!currentUser || !doctorProfile) return;
65-
66-
const { error } = await supabase.from('doctor_profiles').upsert({
67-
profile_id: currentUser.id,
68-
...doctorProfile
69-
});
70-
71-
if (error) {
72-
console.error('Error updating doctor profile:', error);
73-
toast.error(error.message || 'Failed to update doctor profile.');
74-
} else {
75-
toast.success('Doctor profile updated successfully!');
76-
}
77-
};
78-
7961
if (loading) {
8062
return <div>Loading...</div>;
8163
}

src/components/symptom-checker/SymptomForm.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ interface SpeechRecognitionErrorEvent extends Event {
4343
message: string;
4444
}
4545

46-
interface SpeechRecognition {
46+
declare const SpeechRecognition: {
4747
new (): SpeechRecognition;
48-
}
48+
};
4949

5050
interface SymptomFormProps {
5151
onSubmit: (symptoms: string) => void;
@@ -65,11 +65,11 @@ const SymptomForm: React.FC<SymptomFormProps> = ({
6565
const [error, setError] = useState('');
6666
const [speechSupported, setSpeechSupported] = useState(true);
6767
const [recognition, setRecognition] = useState<SpeechRecognition | null>(null);
68-
const [demoExamples, setDemoExamples] = useState<string[]>([
68+
const demoExamples = [
6969
"I've had a persistent cough and sore throat for the past 3 days, with mild fever in the evenings.",
7070
"I have severe headache in the front of my head and sensitivity to light for the last 6 hours.",
7171
"My lower back has been hurting for two weeks, especially when I bend over or sit for long periods."
72-
]);
72+
];
7373

7474

7575
useEffect(() => {
@@ -78,20 +78,21 @@ const SymptomForm: React.FC<SymptomFormProps> = ({
7878

7979

8080
useEffect(() => {
81-
const SpeechRecognition =
82-
(window as any).SpeechRecognition || (window as any).webkitSpeechRecognition;
81+
const SpeechRecognitionAPI =
82+
(window as unknown as { SpeechRecognition?: typeof SpeechRecognition; webkitSpeechRecognition?: typeof SpeechRecognition }).SpeechRecognition ||
83+
(window as unknown as { SpeechRecognition?: typeof SpeechRecognition; webkitSpeechRecognition?: typeof SpeechRecognition }).webkitSpeechRecognition;
8384

84-
if (!SpeechRecognition) {
85+
if (!SpeechRecognitionAPI) {
8586
setSpeechSupported(false);
8687
return;
8788
}
8889

89-
const recognitionInstance = new SpeechRecognition();
90+
const recognitionInstance = new SpeechRecognitionAPI();
9091
recognitionInstance.continuous = true;
9192
recognitionInstance.interimResults = true;
9293
recognitionInstance.lang = 'en-US';
9394

94-
recognitionInstance.onresult = (event: any) => {
95+
recognitionInstance.onresult = (event: SpeechRecognitionEvent) => {
9596
let transcript = '';
9697
for (let i = event.resultIndex; i < event.results.length; i++) {
9798
if (event.results[i].isFinal) {
@@ -103,7 +104,7 @@ const SymptomForm: React.FC<SymptomFormProps> = ({
103104
}
104105
};
105106

106-
recognitionInstance.onerror = (event: any) => {
107+
recognitionInstance.onerror = (event: SpeechRecognitionErrorEvent) => {
107108
console.error('Speech recognition error:', event.error);
108109
setError(`Speech recognition error: ${event.error}`);
109110
setIsRecording(false);

src/components/symptom-checker/SymptomResults.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
Pill,
1616
User
1717
} from 'lucide-react';
18-
import { SymptomResult, Doctor } from '../../types'; // Ensure Doctor type is imported
18+
import { SymptomResult } from '../../types';
1919
import { mockDoctors } from '../../services/mockData';
2020
import Card from '../common/Card';
2121
import Button from '../common/Button';
@@ -60,9 +60,6 @@ const SymptomResults: React.FC<SymptomResultsProps> = ({ result, symptoms = '' }
6060
})
6161
.slice(0, 3); // Limit to top 3 doctors
6262

63-
// ... (The rest of your SymptomResults.tsx component code remains the same as in the previous example)
64-
// renderUrgencyLevel, containerVariants, itemVariants, JSX structure, etc.
65-
6663
const renderUrgencyLevel = () => {
6764
const urgencyConfig = {
6865
mild: {
@@ -100,7 +97,7 @@ const SymptomResults: React.FC<SymptomResultsProps> = ({ result, symptoms = '' }
10097

10198
const urgencyKey = result?.severity ? urgencyMap[result.severity] : undefined;
10299
const urgency = urgencyKey || 'moderate';
103-
const config = urgencyConfig[urgency];
100+
const config = urgencyConfig[urgency] as typeof urgencyConfig.mild;
104101

105102
return (
106103
<motion.div
@@ -185,7 +182,7 @@ const SymptomResults: React.FC<SymptomResultsProps> = ({ result, symptoms = '' }
185182
</h3>
186183
<div className="text-sm text-neutral-500 dark:text-neutral-400 flex items-center">
187184
<Clock className="w-5 h-5 mr-2" />
188-
<span>Analysis confidence: {(result as any).confidence || "High"}</span>
185+
<span>Analysis confidence: {(result as { confidence?: string }).confidence || "High"}</span>
189186
</div>
190187
</div>
191188

src/components/symptom-checker/test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
BadgeCheck,
1212
ChevronRight,
1313
PlusCircle,
14-
FileText,
1514
Utensils,
1615
Pill
1716
} from 'lucide-react';

src/env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ declare namespace NodeJS {
44
}
55
}
66

7-
declare var process: {
7+
declare const process: {
88
env: NodeJS.ProcessEnv;
99
};

0 commit comments

Comments
 (0)