Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 35 additions & 45 deletions frontend/src/components/document/DocumentSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import { useDropzone } from "react-dropzone";
import { Settings } from "lucide-react";
import DocumentSettings from "./DocumentSettings";
import DocumentCard from "./DocumentCard";

Check warning on line 28 in frontend/src/components/document/DocumentSidebar.tsx

View workflow job for this annotation

GitHub Actions / ⚛️ Frontend — TypeScript & Build

'DocumentCard' is defined but never used
import { toast } from "sonner";

interface Props {
Expand Down Expand Up @@ -451,51 +451,41 @@
</p>
)}

<p className="text-xs text-muted-foreground mt-1">
{doc.summary || "📄 No summary available"}
</p>
<div className="flex items-center gap-2 mt-1">
<span className="text-[10px] text-muted-foreground">
{formatSize(doc.file_size)}
</span>
{doc.status === "ready" && (
<>
<span className="text-[10px] text-muted-foreground">
</span>
<span className="text-[10px] text-muted-foreground">
{t("documents.pagesShort", {
count: doc.page_count,
})}
</span>
<span className="text-[10px] text-muted-foreground">
</span>
<span className="text-[10px] text-muted-foreground">
{t("documents.chunks", {
count: doc.chunk_count,
})}
</span>
</>
)}
{doc.status === "processing" && (
<Badge
variant="secondary"
className="text-[9px] h-4 px-1.5"
>
{t("documents.processing")}
</Badge>
)}
{doc.status === "failed" && (
<Badge
variant="destructive"
className="text-[9px] h-4 px-1.5"
>
{t("documents.failed")}
</Badge>
)}
</div>
<DocumentCard document={doc} />
{doc.summary ? (
<details className="text-xs text-muted-foreground mt-1">
<summary className="cursor-pointer">AI Summary</summary>
<p className="mt-1 leading-relaxed">{doc.summary}</p>
</details>
) : (
<p className="text-xs text-muted-foreground mt-1">📄 No summary available</p>
)}
<div className="flex items-center gap-2 mt-1">
<span className="text-[10px] text-muted-foreground">
{formatSize(doc.file_size)}
</span>
{doc.status === "ready" && (
<>
<span className="text-[10px] text-muted-foreground">•</span>
<span className="text-[10px] text-muted-foreground">
{t("documents.pagesShort", { count: doc.page_count })}
</span>
<span className="text-[10px] text-muted-foreground">•</span>
<span className="text-[10px] text-muted-foreground">
{t("documents.chunks", { count: doc.chunk_count })}
</span>
</>
)}
{doc.status === "processing" && (
<Badge variant="secondary" className="text-[9px] h-4 px-1.5">
{t("documents.processing")}
</Badge>
)}
{doc.status === "failed" && (
<Badge variant="destructive" className="text-[9px] h-4 px-1.5">
{t("documents.failed")}
</Badge>
)}
</div>
</div>
<div className="flex items-center gap-1 shrink-0">
{/* Action buttons (Settings and Delete) are only visible on hover and when the document is ready. The settings button is disabled if the document is not ready, and the delete button shows a loader when the document is being deleted. */}
Expand Down
Loading