import type { ParsedArtifactCandidate } from "../../../lib/artifactOcrParser";
import type { ReviewSampleRecord } from "../../../types/global";
import type { ScanSummary } from "../../../lib/scannerSession";
import type { ScanViewControllerResult, ScanViewProps } from "../types";
import type { Dispatch, SetStateAction } from "react";

export interface FieldConfidenceListProps {
  parsedArtifact: ParsedArtifactCandidate;
}

export interface ArtifactResultCardProps {
  parsed: ParsedArtifactCandidate;
}

export interface ReviewSampleCardProps {
  entry: ReviewSampleRecord;
}

export interface ScanSummaryFooterProps {
  devMode: boolean;
  scanSummary: ScanSummary;
  storedTotal: number | null;
}

export interface ScanViewLayoutProps {
  captureSources: ScanViewProps["captureSources"];
  selectedSourceId: string;
  setSelectedSourceId: (value: string) => void;
  latestCapture: ScanViewProps["latestCapture"];
  captureStatus: string;
  refreshCaptureSources: () => Promise<void>;
  captureSelectedSource: ScanViewProps["captureSelectedSource"];
  bridgeReady: boolean;
  controller: ScanViewControllerResult;
  isScanning: boolean;
}

export interface ScanMainSectionProps {
  latestCapture: ScanViewProps["latestCapture"];
  captureStatus: string;
  parsedArtifact: ScanViewControllerResult["parsedArtifact"];
  sourceLabel: string;
  gridLabel: string;
  inventoryLabel: string;
  activeTargetCount: number;
  storedTotal: ScanViewControllerResult["storedTotal"];
  reviewSampleTotal: number;
  learningRulesLoaded: ScanViewControllerResult["learningRulesLoaded"];
  learningRuleCount: number;
  canOpenReviewQueue: boolean;
  autoScanRunning: boolean;
  openReviewQueue: () => void;
  setDetailsOpen: (value: boolean) => void;
}

export interface ScanTopControlsSectionProps {
  captureSources: ScanViewProps["captureSources"];
  selectedSourceId: string;
  setSelectedSourceId: (value: string) => void;
  refreshCaptureSources: () => Promise<void>;
  captureSelectedSource: ScanViewProps["captureSelectedSource"];
  bridgeReady: boolean;
  isScanning: boolean;
  controller: ScanViewControllerResult;
}

export interface ScanModalsSectionProps {
  captureStatus: string;
  latestCapture: ScanViewProps["latestCapture"];
  diagnosticsOpen: boolean;
  settingsOpen: boolean;
  detailsOpen: boolean;
  reviewQueueOpen: boolean;
  controller: ScanViewControllerResult;
  setDiagnosticsOpen: (open: boolean) => void;
  setSettingsOpen: (open: boolean) => void;
  setDetailsOpen: (open: boolean) => void;
  setReviewQueueOpen: (open: boolean) => void;
  setScanSummary: Dispatch<SetStateAction<ScanViewControllerResult["scanSummary"]>>;
}
