fix(frontend): clear TypeScript strict-mode errors
- vite-env.d.ts now declares ImportMetaEnv with the three VITE_* variables the project uses, restoring proper typing for import.meta.env in apiClient.ts. - QualityFlag.tsx widens its 'flags' prop to accept the domain QualityFlags type, the loose Record form used in mocks, or null, ending the structural-mismatch errors at five callsites (DocumentsPage, DocumentViewerPage, QualityControlPage, ChunkPreview, SearchResultCard). - DashboardPage trend callbacks are typed against DashboardStats so the implicit-any complaints disappear without weakening intent. npx tsc --noEmit -> clean. vite build -> ok. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { FileText, Layers, ShieldAlert, Sparkles, Cpu, Database } from "lucide-react";
|
||||
|
||||
import type { DashboardStats } from "@/services/types";
|
||||
import { PageHeader } from "@/components/common/PageHeader";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { KpiCard } from "@/widgets/KpiCard";
|
||||
@@ -39,7 +40,7 @@ export function DashboardPage() {
|
||||
delta={4.2}
|
||||
icon={<FileText className="h-4 w-4" />}
|
||||
tone="primary"
|
||||
trend={data?.daily_ingest.slice(-12).map((d) => d.ingested) ?? []}
|
||||
trend={data?.daily_ingest.slice(-12).map((d: DashboardStats["daily_ingest"][number]) => d.ingested) ?? []}
|
||||
/>
|
||||
<KpiCard
|
||||
label="OCR confidence"
|
||||
@@ -48,7 +49,7 @@ export function DashboardPage() {
|
||||
delta={1.3}
|
||||
icon={<Layers className="h-4 w-4" />}
|
||||
tone="success"
|
||||
trend={data?.ocr_distribution.map((d) => d.count) ?? []}
|
||||
trend={data?.ocr_distribution.map((d: DashboardStats["ocr_distribution"][number]) => d.count) ?? []}
|
||||
/>
|
||||
<KpiCard
|
||||
label="Needs manual review"
|
||||
|
||||
Reference in New Issue
Block a user