feat(sp7): MatchedRemitCard — line-count badge

This commit is contained in:
Tyler
2026-06-20 19:47:11 -06:00
parent 00cdd068fc
commit b538c0939b
3 changed files with 80 additions and 0 deletions
@@ -38,6 +38,12 @@ export function MatchedRemitCard({ matchedRemittance }: MatchedRemitCardProps) {
if (matchedRemittance === null) return null;
const { id, totalPaid, status, receivedAt } = matchedRemittance;
// SP7: per-line counts may be missing on pre-SP7 claim-detail responses.
const matchedLines = matchedRemittance.matchedLines;
const totalLines = matchedRemittance.totalLines;
const hasLineCounts =
typeof matchedLines === "number" && typeof totalLines === "number";
const allMatched = hasLineCounts && matchedLines === totalLines;
const handleViewRemittance = () => {
window.location.href = `/remittances?id=${id}`;
@@ -109,6 +115,18 @@ export function MatchedRemitCard({ matchedRemittance }: MatchedRemitCardProps) {
</Button>
</div>
</div>
{hasLineCounts ? (
<span
data-testid="matched-remit-line-counts"
data-all-matched={allMatched ? "true" : "false"}
className="font-mono text-xs uppercase tracking-wider"
style={{ color: allMatched ? "var(--tt-amber)" : "var(--tt-oxblood)" }}
>
lines: {matchedLines}/{totalLines} matched
{!allMatched ? ` (${totalLines! - matchedLines!} unmatched)` : null}
</span>
) : null}
</section>
);
}