Skip to content

[Frontend · File verification UI] Create DocumentExpiryBadge component (#259)#301

Open
Ayomisco wants to merge 2 commits intoamina69:mainfrom
Ayomisco:feat/document-expiry-badge-259
Open

[Frontend · File verification UI] Create DocumentExpiryBadge component (#259)#301
Ayomisco wants to merge 2 commits intoamina69:mainfrom
Ayomisco:feat/document-expiry-badge-259

Conversation

@Ayomisco
Copy link
Copy Markdown

Summary

Creates DocumentExpiryBadge component for displaying document expiry status in file verification UI.

What's Changed

  • New component: DocumentExpiryBadge.tsx

    • No badge: null expiresAt or expiring 8+ days away
    • Amber badge: "Expiring in X days" for documents within 7 days
    • Red badge: "Expired — re-upload required" for expired documents
    • Hover tooltip with exact expiry date + AlertCircle icon
  • Comprehensive tests: 15 test cases included

    • Null threshold (no badge shown)
    • Amber threshold (within 7 days)
    • Red threshold (expired documents)
    • Edge cases (pluralization, ISO format, expiring today)
  • Updated mock data: Document interface now includes expiresAt?: string | null field

Verification

  • ✅ All 340 tests passing (including 15 new DocumentExpiryBadge tests)
  • ✅ ESLint: 0 errors
  • ✅ TypeScript strict: No errors
  • ✅ All three badge states tested and working

Closes #259

- Add DocumentExpiryBadge component showing document expiry status
- null: no badge, within 7 days: amber 'Expiring in X days', expired: red 'Expired — re-upload required'
- Includes AlertCircle icon and hover tooltip with exact expiry date
- Add 15 comprehensive unit tests covering all thresholds
- Update Document mock type to include optional expiresAt field
- All checks: 340/340 tests passing, lint clean, TypeScript strict

Closes amina69#259
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 29, 2026

@Ayomisco Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@amina69
Copy link
Copy Markdown
Owner

amina69 commented Mar 30, 2026

@Ayomisco conflict, fixed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Frontend · File verification UI] Create DocumentExpiryBadge component

2 participants