feat(upload): display no-defects analysis result
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { CircleX, TicketCheck } from 'lucide-react';
|
import { CircleMinus, CircleX, TicketCheck } from 'lucide-react';
|
||||||
|
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import type { UploadListItem } from '@/types';
|
import type { UploadListItem } from '@/types';
|
||||||
@@ -30,5 +30,17 @@ export function UploadResultCell({ item }: { item: UploadListItem }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (item.result === 'no_defects_found') {
|
||||||
|
return (
|
||||||
|
<div className="space-y-1">
|
||||||
|
<div className="flex items-center gap-1.5 text-xs font-medium text-amber-500">
|
||||||
|
<CircleMinus className="size-3.5" /> No Defects Found
|
||||||
|
</div>
|
||||||
|
<p className="text-xs text-muted-foreground">
|
||||||
|
{item.total_detections ?? 0} issues detected
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
return <span className="text-muted-foreground">—</span>;
|
return <span className="text-muted-foreground">—</span>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
export type UploadStatus = 'queued' | 'processing' | 'completed' | 'failed';
|
export type UploadStatus = 'queued' | 'processing' | 'completed' | 'failed';
|
||||||
export type UploadResult = 'ticket_created' | 'analysis_failed' | null;
|
export type UploadResult =
|
||||||
|
| 'ticket_created'
|
||||||
|
| 'no_defects_found'
|
||||||
|
| 'analysis_failed'
|
||||||
|
| null;
|
||||||
export type UploadEventKind = 'created' | 'progressed' | 'transitioned';
|
export type UploadEventKind = 'created' | 'progressed' | 'transitioned';
|
||||||
|
|
||||||
export interface UploadListItem {
|
export interface UploadListItem {
|
||||||
@@ -16,6 +20,8 @@ export interface UploadListItem {
|
|||||||
is_uploaded: boolean;
|
is_uploaded: boolean;
|
||||||
status: UploadStatus;
|
status: UploadStatus;
|
||||||
progress: number;
|
progress: number;
|
||||||
|
message: string | null;
|
||||||
|
total_detections: number | null;
|
||||||
result: UploadResult;
|
result: UploadResult;
|
||||||
ticket_id: string | null;
|
ticket_id: string | null;
|
||||||
ticket_name: string | null;
|
ticket_name: string | null;
|
||||||
|
|||||||
Reference in New Issue
Block a user