Add Fetch Request pipeline UI with real-time SSEs #8
@@ -445,13 +445,13 @@ export default function FetchRequestDetail() {
|
|||||||
<Box sx={{ display: "flex", gap: 3, mb: 1.5, flexWrap: "wrap" }}>
|
<Box sx={{ display: "flex", gap: 3, mb: 1.5, flexWrap: "wrap" }}>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography variant="caption" color="text.secondary">OCR Amount</Typography>
|
<Typography variant="caption" color="text.secondary">OCR Amount</Typography>
|
||||||
<Typography variant="body2" sx={{ textDecoration: "line-through", color: "error.main" }}>
|
<Typography variant="body2" sx={{ textDecoration: "line-through", color: "text.secondary" }}>
|
||||||
₹{ambiguity.ocr_amount}
|
₹{ambiguity.ocr_amount}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography variant="caption" color="text.secondary">OCR Balance</Typography>
|
<Typography variant="caption" color="text.secondary">OCR Balance</Typography>
|
||||||
<Typography variant="body2" sx={{ textDecoration: "line-through", color: "error.main" }}>
|
<Typography variant="body2" sx={{ textDecoration: "line-through", color: "text.secondary" }}>
|
||||||
₹{ambiguity.ocr_balance}
|
₹{ambiguity.ocr_balance}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
@@ -468,7 +468,9 @@ export default function FetchRequestDetail() {
|
|||||||
) : (
|
) : (
|
||||||
<Box sx={{ display: "flex", gap: 1, flexWrap: "wrap" }}>
|
<Box sx={{ display: "flex", gap: 1, flexWrap: "wrap" }}>
|
||||||
{ambiguity.candidates.map((candidate: any, ci: number) => {
|
{ambiguity.candidates.map((candidate: any, ci: number) => {
|
||||||
const valid = isMathValid(candidate, ambiguity.prev_balance);
|
const isCredit = candidate.amount > 0;
|
||||||
|
const isDebit = candidate.amount < 0;
|
||||||
|
const cColor = isCredit ? "success.main" : isDebit ? "error.main" : undefined;
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
key={ci}
|
key={ci}
|
||||||
@@ -477,13 +479,12 @@ export default function FetchRequestDetail() {
|
|||||||
onClick={() => handleResolve(ambiguity, candidate)}
|
onClick={() => handleResolve(ambiguity, candidate)}
|
||||||
disabled={resolveMutation.isPending}
|
disabled={resolveMutation.isPending}
|
||||||
sx={{
|
sx={{
|
||||||
borderColor: valid ? "success.main" : undefined,
|
borderColor: cColor,
|
||||||
color: valid ? "success.main" : undefined,
|
color: cColor,
|
||||||
"&:hover": valid ? { borderColor: "success.dark", bgcolor: "success.contrastText" } : undefined,
|
"&:hover": cColor ? { borderColor: cColor } : undefined,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
₹{candidate.amount} / ₹{candidate.balance}
|
₹{candidate.amount} / ₹{candidate.balance}
|
||||||
{valid && " ✓"}
|
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|||||||
Reference in New Issue
Block a user