|
1 | | -import React, { useState, useEffect, useCallback } from 'react'; |
| 1 | +import React, { useState, useEffect } from 'react'; |
2 | 2 | import { useAuth } from '../contexts/AuthContext'; |
3 | | -import { getFunctions, httpsCallable } from 'firebase/functions'; |
| 3 | +import { getFunctions } from 'firebase/functions'; |
4 | 4 | import { getFirestore, collection, query, orderBy, limit, onSnapshot, doc, getDoc } from 'firebase/firestore'; |
5 | 5 | import { calculateCurrentGrade, predictFinalGrade } from '../services/gradeService'; |
6 | 6 | import DocumentProcessingStatus from './DocumentProcessingStatus'; |
@@ -36,12 +36,11 @@ const PredictionPanel: React.FC = () => { |
36 | 36 | const { currentUser } = useAuth(); |
37 | 37 | const [isPredicting, setIsPredicting] = useState<boolean>(false); |
38 | 38 | const [predictionResult, setPredictionResult] = useState<Prediction | null>(null); |
39 | | - const [documents, setDocuments] = useState<Document[]>([]); |
| 39 | + const [documents] = useState<Document[]>([]); |
40 | 40 | const [error, setError] = useState<string | null>(null); |
41 | 41 | const [status, setStatus] = useState<string>(''); |
42 | 42 | const [processingComplete, setProcessingComplete] = useState<boolean>(false); |
43 | 43 |
|
44 | | - const functions = getFunctions(); |
45 | 44 | const db = getFirestore(); |
46 | 45 |
|
47 | 46 | // Listen for documents and predictions |
@@ -130,11 +129,12 @@ const PredictionPanel: React.FC = () => { |
130 | 129 | // Determine if we can make a prediction based on document status or processing completion |
131 | 130 | const canPredict = documents.some(doc => doc.status === 'processed') || processingComplete; |
132 | 131 |
|
| 132 | + // We'll keep this comment to document what we're calculating, but remove the unused variable |
133 | 133 | // Get count of documents by type |
134 | | - const docCounts = documents.reduce((acc: Record<string, number>, doc) => { |
135 | | - acc[doc.documentType] = (acc[doc.documentType] || 0) + 1; |
136 | | - return acc; |
137 | | - }, {}); |
| 134 | + // const docCounts = documents.reduce((acc: Record<string, number>, doc) => { |
| 135 | + // acc[doc.documentType] = (acc[doc.documentType] || 0) + 1; |
| 136 | + // return acc; |
| 137 | + // }, {}); |
138 | 138 |
|
139 | 139 | return ( |
140 | 140 | <div style={styles.container}> |
|
0 commit comments