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:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user