feat: implement OCR parsing status tracking and biomarker count display
This commit is contained in:
@@ -7,6 +7,8 @@ interface Source {
|
||||
file_path: string
|
||||
file_type: string
|
||||
file_size: number
|
||||
status: string
|
||||
biomarker_count: number | null
|
||||
ocr_data: string | null
|
||||
description: string | null
|
||||
uploaded_at: string
|
||||
@@ -217,17 +219,30 @@ export function SourcesPage() {
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex gap-sm items-center">
|
||||
{source.ocr_data ? (
|
||||
{source.status === 'parsed' ? (
|
||||
<span className="status-parsed flex items-center gap-xs text-xs">
|
||||
<img src="/icons/general/icons8-checkmark-50.png" alt="Parsed" className="icon-sm" /> Parsed
|
||||
<img src="/icons/general/icons8-checkmark-50.png" alt="Parsed" className="icon-sm" />
|
||||
{source.biomarker_count ? `${source.biomarker_count} biomarkers` : 'Parsed'}
|
||||
</span>
|
||||
) : source.status === 'processing' ? (
|
||||
<span className="status-processing text-xs text-secondary">
|
||||
Processing...
|
||||
</span>
|
||||
) : source.status === 'failed' ? (
|
||||
<button
|
||||
className="btn btn-primary btn-sm"
|
||||
onClick={() => handleParse(source.id)}
|
||||
disabled={parsingId === source.id}
|
||||
>
|
||||
Retry
|
||||
</button>
|
||||
) : (
|
||||
<button
|
||||
className="btn btn-primary btn-sm"
|
||||
onClick={() => handleParse(source.id)}
|
||||
disabled={parsingId === source.id}
|
||||
>
|
||||
{parsingId === source.id ? 'Parsing...' : 'Parse'}
|
||||
Parse
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user