- Localize 23 transaction UI component files - Add 150+ translation keys to ko.json and en.json - Organized translations under transaction namespace: * transaction.bottomSheet - Bottom sheet modals * transaction.sections - Section titles * transaction.fields - Field labels (90+ keys) * transaction.cancel - Cancellation flows * transaction.handWrittenIssuance - Manual issuance forms * transaction.list - List actions Updated files: - Bottom sheets: escrow-mail-resend, cash-receipt-purpose-update - Sections: billing-info, part-cancel-info, detail-info, issue-info, escrow-info, important-info, payment-info, transaction-info, settlement-info, merchant-info, amount-info, cancel-bank-group, cancel-password-group - Lists: list-item, billing-list, cash-receipt-list - Cancel flows: all-cancel, part-cancel, prevent-bond - Issuance: hand-written-issuance-step1, hand-written-issuance-step2 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
74 lines
1.9 KiB
TypeScript
74 lines
1.9 KiB
TypeScript
import { PATHS } from '@/shared/constants/paths';
|
|
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
|
import { CashReceiptListProps } from '../model/types';
|
|
import { ListDateGroup } from './list-date-group';
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
export const CashReceiptList = ({
|
|
transactionCategory,
|
|
listItems
|
|
}: CashReceiptListProps) => {
|
|
const { navigate } = useNavigate();
|
|
const { t } = useTranslation();
|
|
|
|
const getListDateGroup = () => {
|
|
let rs = [];
|
|
let date = '';
|
|
let list = [];
|
|
for(let i=0;i<listItems.length;i++){
|
|
let item = listItems[i];
|
|
if(!!item){
|
|
let transactionDate = item.transactionDate;
|
|
if(!!transactionDate){
|
|
if(i === 0){
|
|
date = transactionDate;
|
|
}
|
|
if(date !== transactionDate){
|
|
if(list.length > 0){
|
|
rs.push(
|
|
<ListDateGroup
|
|
transactionCategory={ transactionCategory }
|
|
key={ date + '-' + i }
|
|
date={ date }
|
|
items={ list }
|
|
></ListDateGroup>
|
|
);
|
|
}
|
|
date = transactionDate;
|
|
list = [];
|
|
}
|
|
list.push(item);
|
|
}
|
|
}
|
|
}
|
|
if(list.length > 0){
|
|
rs.push(
|
|
<ListDateGroup
|
|
transactionCategory={ transactionCategory }
|
|
key={ date + '-last' }
|
|
date={ date }
|
|
items={ list }
|
|
></ListDateGroup>
|
|
);
|
|
}
|
|
return rs;
|
|
};
|
|
|
|
const onClickToNavigate = () => {
|
|
navigate(PATHS.transaction.cashReceipt.handWrittenIssuance);
|
|
};
|
|
|
|
return (
|
|
<>
|
|
<div className="transaction-list">
|
|
{ getListDateGroup() }
|
|
</div>
|
|
<div className="apply-row">
|
|
<button
|
|
className="btn-50 btn-blue flex-1"
|
|
onClick={ () => onClickToNavigate() }
|
|
>{ t('transaction.list.manualIssuance') }</button>
|
|
</div>
|
|
</>
|
|
);
|
|
}; |