Commit Graph

5 Commits

Author SHA1 Message Date
4d46456ada refactor: reduce code duplication by using reusable components
- Delete duplicate page-new.tsx in verification folder
- Create reusable StatCard component in components/ui
- Enhance StatusBadge component with icons and REJECTED status
- Refactor 7 files to use StatusBadge instead of local getStatusBadge
- Refactor Statistics.tsx to use shared StatCard component
- Reduces overall code duplication from 9.85% to lower

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 16:50:05 +01:00
eded0187a0 fix: replace apiFetch with api service methods
- hooks/index.ts: remove non-existent exports (apiFetch, getAuthToken)
- app/employe/gains-client/page.tsx: use api.get and api.post
- app/employe/historique/page.tsx: use api.get

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 15:38:18 +01:00
467696e5b8 refactor: add more shared utilities and reduce duplication further
- Add utils/export.ts for centralized CSV export functionality
- Add EmptyState component for consistent empty state UI
- Add Pagination component for reusable pagination controls
- Refactor employe/gains-client to use apiFetch and EmptyState
- Refactor employe/historique to use apiFetch and EmptyState
- Export new components from ui/index.ts

Target: reduce duplication from 13.93% to under 3%

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 23:39:01 +01:00
34474cc275 fix: use API_BASE_URL constant instead of direct env access
Replace all instances of process.env.NEXT_PUBLIC_API_URL with
API_BASE_URL constant for consistency and to ensure the API URL
is properly defined at runtime.

Files updated:
- app/admin/marketing-data/page.tsx
- app/admin/tirages/page.tsx
- app/employe/dashboard/page.tsx
- app/employe/gains-client/page.tsx
- app/employe/historique/page.tsx
- components/admin/TicketManagement.tsx

This fixes the "undefined" API URL issue that was preventing
API calls from working correctly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 15:07:49 +01:00
2f7abde4ea dev 2025-11-17 23:38:02 +01:00