refactor(frontend): replace status string literals with constants

- Create constants/statuses.js with MATCH_STATUS, SUGGESTION_STATUS, MATCH_FILTER
- Update MatchCard, MatchesPage, HistoryPage, RatePartnerPage to use MATCH_STATUS
- Update RecordingTab to use SUGGESTION_STATUS
- Update Navbar to use MATCH_STATUS for API calls
This commit is contained in:
Radosław Gierwiało
2025-11-23 22:21:12 +01:00
parent 93ff331bfb
commit b3a6d39d7a
8 changed files with 64 additions and 29 deletions

View File

@@ -1,14 +1,15 @@
import { Link } from 'react-router-dom';
import { MessageCircle, Check, X, Loader2, Calendar, MapPin } from 'lucide-react';
import { MATCH_STATUS } from '../../constants';
/**
* Match card for matches list page
* Shows match details with accept/reject/chat actions
*/
const MatchCard = ({ match, onAccept, onReject, onOpenChat, processing }) => {
const isIncoming = !match.isInitiator && match.status === 'pending';
const isOutgoing = match.isInitiator && match.status === 'pending';
const isAccepted = match.status === 'accepted';
const isIncoming = !match.isInitiator && match.status === MATCH_STATUS.PENDING;
const isOutgoing = match.isInitiator && match.status === MATCH_STATUS.PENDING;
const isAccepted = match.status === MATCH_STATUS.ACCEPTED;
return (
<div className="bg-white rounded-lg shadow-sm border border-gray-200 p-4 hover:shadow-md transition-shadow">