arbret/frontend/app/components
counterweight 1a47b3643f
Extract reusable UI components to reduce DRY violations
- Created StatusBadge component: Standardizes status badge display
  - Supports tradeStatus prop for trade-specific styling
  - Supports variant prop for simple badges (success/error/ready)
  - Eliminates repetitive badge style combinations

- Created EmptyState component: Standardizes empty state display
  - Handles loading and empty states consistently
  - Supports message, hint, and action props
  - Used across trades, invites, admin pages

- Created ConfirmationButton component: Standardizes confirmation flows
  - Two-step confirmation pattern (action -> confirm/cancel)
  - Supports different variants (danger/success/primary)
  - Handles loading states automatically
  - Used for cancel, complete, no-show actions

- Migrated pages to use new components:
  - trades/page.tsx: StatusBadge, EmptyState, ConfirmationButton
  - trades/[id]/page.tsx: StatusBadge
  - invites/page.tsx: StatusBadge, EmptyState
  - admin/trades/page.tsx: StatusBadge, EmptyState, ConfirmationButton
  - admin/invites/page.tsx: StatusBadge

Benefits:
- Eliminated ~50+ lines of repetitive badge styling code
- Consistent UI patterns across all pages
- Easier to maintain and update styling
- Better type safety

All tests passing (32 frontend, 33 e2e)
2025-12-25 21:40:07 +01:00
..
ConfirmationButton.tsx Extract reusable UI components to reduce DRY violations 2025-12-25 21:40:07 +01:00
EmptyState.tsx Extract reusable UI components to reduce DRY violations 2025-12-25 21:40:07 +01:00
ErrorDisplay.tsx Refactor frontend: Add reusable hooks and components 2025-12-25 21:30:35 +01:00
Header.tsx refactor: Extract SatsDisplay component and fix page IDs 2025-12-23 10:44:11 +01:00
LoadingState.tsx refactor(frontend): improve code quality and maintainability 2025-12-25 19:04:45 +01:00
PageLayout.tsx Refactor frontend: Add reusable hooks and components 2025-12-25 21:30:35 +01:00
SatsDisplay.tsx refactor: import React types directly instead of namespace 2025-12-23 12:23:32 +01:00
StatusBadge.tsx Extract reusable UI components to reduce DRY violations 2025-12-25 21:40:07 +01:00
Toast.tsx refactor(frontend): improve code quality and maintainability 2025-12-25 19:04:45 +01:00