- 현금영수증 페이지 다국어화 (목록, 상세, 수기발행) * 승인/취소 금액 통화 표기 개선 (₩ prefix for EN) * 검색옵션, 다운로드, 용도변경 등 모든 텍스트 다국어화 - 에스크로 페이지 다국어화 (목록, 상세) * 헤더 타이틀 및 UI 텍스트 다국어화 - 빌링 페이지 다국어화 (목록, 상세, 청구) * 통화 표기 언어별 처리 (한국어: 원 suffix / 영어: ₩ prefix) - 번역 키 추가: cashReceipt, escrow, billing, common 네임스페이스 - 모든 거래 페이지 일관된 다국어 지원 완료 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
97 lines
3.3 KiB
TypeScript
97 lines
3.3 KiB
TypeScript
import { useEffect, useState } from 'react';
|
|
import { useTranslation } from 'react-i18next';
|
|
import { useLocation } from 'react-router';
|
|
import { PATHS } from '@/shared/constants/paths';
|
|
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
|
import { useBillingDetailMutation } from '@/entities/transaction/api/use-billing-detail-mutation';
|
|
import { BillingInfoSection } from '@/entities/transaction/ui/section/billing-info-section';
|
|
import { HeaderType } from '@/entities/common/model/types';
|
|
import {
|
|
TransactionCategory,
|
|
BillingDetailParams,
|
|
BillingDetailResponse,
|
|
BillingInfo,
|
|
AmountInfo
|
|
} from '@/entities/transaction/model/types';
|
|
import {
|
|
useSetOnBack,
|
|
useSetHeaderTitle,
|
|
useSetHeaderType,
|
|
useSetFooterMode
|
|
} from '@/widgets/sub-layout/use-sub-layout';
|
|
import { NumericFormat } from 'react-number-format';
|
|
import { C } from 'node_modules/react-router/dist/development/index-react-server-client-DRhjXpk2.mjs';
|
|
import { AmountInfoSection } from '@/entities/transaction/ui/section/amount-info-section';
|
|
|
|
export const BillingDetailPage = () => {
|
|
const { navigate } = useNavigate();
|
|
const { t, i18n } = useTranslation();
|
|
const location = useLocation();
|
|
const tid = location?.state.tid;
|
|
const serviceCode = location?.state.serviceCode;
|
|
|
|
|
|
const [billingInfo, setBillingInfo] = useState<BillingInfo>();
|
|
const [amountInfo, setAmountInfo] = useState<AmountInfo>();
|
|
|
|
useSetHeaderTitle(t('billing.detailTitle'));
|
|
useSetHeaderType(HeaderType.RightClose);
|
|
useSetOnBack(() => {
|
|
navigate(PATHS.transaction.billing.list);
|
|
});
|
|
useSetFooterMode(false);
|
|
|
|
const { mutateAsync: billingDetail } = useBillingDetailMutation();
|
|
|
|
const callDetail = () => {
|
|
let billingDetailParams: BillingDetailParams = {
|
|
tid: tid
|
|
};
|
|
billingDetail(billingDetailParams).then((rs: BillingDetailResponse) => {
|
|
setBillingInfo(rs);
|
|
setAmountInfo({
|
|
transactionAmount: rs.transactionAmount,
|
|
buyerName: rs.buyerName
|
|
})
|
|
});
|
|
};
|
|
useEffect(() => {
|
|
callDetail();
|
|
}, []);
|
|
|
|
return (
|
|
<>
|
|
<main>
|
|
<div className="tab-content">
|
|
<div className="tab-pane sub active">
|
|
<div className="option-list">
|
|
<div className="txn-detail">
|
|
<div className="txn-num-group">
|
|
<div className="txn-amount">
|
|
<div className="value">
|
|
{ i18n.language === 'en' && <span className="unit">{ t('home.currencySymbol') }</span> }
|
|
<NumericFormat
|
|
value={ amountInfo?.transactionAmount }
|
|
thousandSeparator
|
|
displayType="text"
|
|
></NumericFormat>
|
|
{ i18n.language !== 'en' && <span className="unit">{ t('home.currencyWon') }</span> }
|
|
</div>
|
|
</div>
|
|
<div className="txn-mid">
|
|
<span className="value">{ amountInfo?.buyerName }</span>
|
|
</div>
|
|
<div className="txn-doc"></div>
|
|
</div>
|
|
<div className="txn-divider"></div>
|
|
<BillingInfoSection
|
|
billingInfo={ billingInfo }
|
|
></BillingInfoSection>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</>
|
|
);
|
|
}; |