"use client";
import {
CheckCircle2,
FileText,
LoaderCircle,
TriangleAlert,
} from "lucide-react";
import { useTranslation } from "react-i18next";
import type {
AttachmentProcessingItem,
AttachmentProcessingPhase,
} from "@/features/chat/selectors/attachment-processing";
function phaseLabel(
phase: AttachmentProcessingPhase,
t: (key: string) => string,
): string {
switch (phase) {
case "uploading":
return t("Sending to DeepTutor");
case "received":
return t("Uploaded to DeepTutor");
case "submitting":
return t("Sending to document parser");
case "parsing":
return t("Document parser is processing");
case "retrieving":
return t("Retrieving parsed result");
case "completed":
return t("Ready for this answer");
case "fallback":
return t("Using local PDF text");
case "failed":
return t("Document parsing failed");
}
}
function PhaseIcon({ phase }: { phase: AttachmentProcessingPhase }) {
if (phase === "completed") {
return
{item.detail}