Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/pages/artBuyerPage/components/menuMyPage/Auction/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ export const ArtBuyerAuction = () => {
navigate(`/auction/${auctionId}`);
};

// status 값을 한글로 변환하는 함수
const getStatusText = (status: string) => {
const statusMap: Record<string, string> = {
BID: '응찰중',
PARTICIPATE: '입찰중',
};
return statusMap[status] || status; // 기본적으로 원래 상태값 유지
};

return (
<AuctionContainer>
<h1>경매</h1>
Expand All @@ -44,9 +53,9 @@ export const ArtBuyerAuction = () => {
{new Date(auction.bid_date).toLocaleDateString('ko-KR')}
</TableCell>
<TableCell>{`₩${auction.bid_price.toLocaleString()}`}</TableCell>
<TableCell>{auction.status}</TableCell>
<TableCell>{getStatusText(auction.status)}</TableCell>
<TableCell>
{auction.status === '응찰중' && (
{auction.status === 'BID' && (
<AuctionButton
onClick={() => handleBtnClick(auction.auction_id)}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ export const Payment = () => {
initiatePayment(paymentId);
};

const getPaymentStatus = (status: string) => {
if (status === 'COMPLETED') return '결제 완료';
if (status === 'PENDING') return '낙찰';
return status;
};

return (
<PaymentContainer>
<h1>결제</h1>
Expand All @@ -45,7 +51,7 @@ export const Payment = () => {
<TableCell>
{new Date(payment.created_at).toLocaleDateString('ko-KR')}
</TableCell>
<TableCell>{payment.payment_status}</TableCell>
<TableCell>{getPaymentStatus(payment.payment_status)}</TableCell>
<TableCell>
{payment.payment_status === '결제 대기중' && (
<PaymentButton
Expand Down
Loading