Fix TypeScript errors in additional-service module
Updated 24 files to resolve 111 TypeScript compilation errors by: - Updating imports from direct constant exports to getter functions - Adding i18n support with useTranslation hook - Fixing curried function calls to use translation function parameter - Adding explicit type annotations to map callbacks All filter components, list wrappers, and page components now properly use internationalized getter functions for status text and button groups. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -308,10 +308,10 @@ export const ListItem = ({
|
||||
const getStatus = () => {
|
||||
let statusText = '';
|
||||
if (additionalServiceCategory === AdditionalServiceCategory.FundAccountTransfer) {
|
||||
statusText = getFundAccountStatusName(resultStatus);
|
||||
statusText = getFundAccountStatusName(t)(resultStatus);
|
||||
}
|
||||
else if (additionalServiceCategory === AdditionalServiceCategory.FundAccountResult) {
|
||||
statusText = getFundAccountResultStatusName(resultStatus);
|
||||
statusText = getFundAccountResultStatusName(t)(resultStatus);
|
||||
}
|
||||
else if (additionalServiceCategory === AdditionalServiceCategory.AccountHolderSearch) {
|
||||
statusText = resultStatus || '';
|
||||
@@ -320,16 +320,16 @@ export const ListItem = ({
|
||||
statusText = authStatus || '';
|
||||
}
|
||||
else if (additionalServiceCategory === AdditionalServiceCategory.FaceAuth) {
|
||||
statusText = getTransTypeText(transType)
|
||||
statusText = getTransTypeText(t)(transType)
|
||||
}
|
||||
else if (additionalServiceCategory === AdditionalServiceCategory.SMSPayment) {
|
||||
statusText = getSmsClName(smsCl);
|
||||
statusText = getSmsClName(t)(smsCl);
|
||||
}
|
||||
else if (additionalServiceCategory === AdditionalServiceCategory.KeyInPayment) {
|
||||
statusText = getKeyInPaymentPaymentStatusName(transactionType)
|
||||
statusText = getKeyInPaymentPaymentStatusName(t)(transactionType)
|
||||
}
|
||||
else if (additionalServiceCategory === AdditionalServiceCategory.Ars) {
|
||||
statusText = getArsPaymentStatusName(paymentStatus)
|
||||
statusText = getArsPaymentStatusName(t)(paymentStatus)
|
||||
}
|
||||
else {
|
||||
statusText = resultStatus || status || '';
|
||||
@@ -377,7 +377,7 @@ export const ListItem = ({
|
||||
str = `${buyerName}(${tid})`;
|
||||
}
|
||||
else if (additionalServiceCategory === AdditionalServiceCategory.Alimtalk) {
|
||||
str = `${receiverName}(${getAlimtalkSendTypeText(sendType)})`;
|
||||
str = `${receiverName}(${getAlimtalkSendTypeText(t)(sendType)})`;
|
||||
}
|
||||
|
||||
return str;
|
||||
@@ -419,8 +419,8 @@ export const ListItem = ({
|
||||
<span className="separator">|</span>
|
||||
<span>
|
||||
{authResult === 'FAIL'
|
||||
? `${getAuthResultStatusText(authResult)}: ${failReason}`
|
||||
: getAuthResultStatusText(authResult)
|
||||
? `${getAuthResultStatusText(t)(authResult)}: ${failReason}`
|
||||
: getAuthResultStatusText(t)(authResult)
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
@@ -430,17 +430,17 @@ export const ListItem = ({
|
||||
if (paymentStatus === "0" || paymentStatus === "3" || paymentStatus === "4") {
|
||||
rs.push(
|
||||
<div key="link-payment-history" className="transaction-details">
|
||||
<span>{getPaymentStatusText(paymentStatus)}</span>
|
||||
<span>{getPaymentStatusText(t)(paymentStatus)}</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{getSendMethodText(sendMethod)}</span>
|
||||
<span>{getSendMethodText(t)(sendMethod)}</span>
|
||||
</div>
|
||||
)
|
||||
} else {
|
||||
rs.push(
|
||||
<div key="link-payment-history" className="transaction-details">
|
||||
<span>{getPaymentStatusText(paymentStatus)}</span>
|
||||
<span>{getPaymentStatusText(t)(paymentStatus)}</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{getSendMethodText(sendMethod)}</span>
|
||||
<span>{getSendMethodText(t)(sendMethod)}</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{paymentMethod}</span>
|
||||
</div>
|
||||
@@ -450,16 +450,16 @@ export const ListItem = ({
|
||||
else if (additionalServiceCategory === AdditionalServiceCategory.LinkPaymentWait) {
|
||||
rs.push(
|
||||
<div key="link-payment-wait" className="transaction-details">
|
||||
<span>{getProcessStatusText(processStatus)}</span>
|
||||
<span>{getProcessStatusText(t)(processStatus)}</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{getSendMethodText(sendMethod)}</span>
|
||||
<span>{getSendMethodText(t)(sendMethod)}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
else if (additionalServiceCategory === AdditionalServiceCategory.Payout) {
|
||||
rs.push(
|
||||
<div className="transaction-details">
|
||||
<span>{getPayoutStatusText(status)}</span>
|
||||
<span>{getPayoutStatusText(t)(status)}</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{submallId}</span>
|
||||
</div>
|
||||
@@ -499,7 +499,7 @@ export const ListItem = ({
|
||||
<span className="separator">|</span>
|
||||
<span>{getStatus()}</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{getArsOrderStatusName(orderStatus)}</span>
|
||||
<span>{getArsOrderStatusName(t)(orderStatus)}</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{transactionType}</span>
|
||||
</div>
|
||||
@@ -511,9 +511,9 @@ export const ListItem = ({
|
||||
<div className="transaction-details">
|
||||
<span>{getTime()}</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{getAlimtalkServiceCodeText(serviceCode)}</span>
|
||||
<span>{getAlimtalkServiceCodeText(t)(serviceCode)}</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{getAlimtalkAlimClText(alimCl)}</span>
|
||||
<span>{getAlimtalkAlimClText(t)(alimCl)}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -605,7 +605,7 @@ export const ListItem = ({
|
||||
else if (additionalServiceCategory === AdditionalServiceCategory.Alimtalk) {
|
||||
rs.push(
|
||||
<div key="payout-item-amount" className={`status-label ${(sendCl === 'REQUEST' || sendCl === 'SUCCESS') ? 'success' : 'fail'}`}
|
||||
>{getAlimtalkSendClTypeText(sendCl)}</div>
|
||||
>{getAlimtalkSendClTypeText(t)(sendCl)}</div>
|
||||
);
|
||||
}
|
||||
else if (additionalServiceCategory === AdditionalServiceCategory.SMSPayment && onResendClick) {
|
||||
|
||||
Reference in New Issue
Block a user