@djangocfg/ext-payments 1.0.21 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.cjs +14 -5
- package/dist/config.js +14 -5
- package/dist/i18n.cjs +434 -0
- package/dist/i18n.d.cts +172 -0
- package/dist/i18n.d.ts +172 -0
- package/dist/i18n.js +406 -0
- package/dist/index.cjs +653 -113
- package/dist/index.js +654 -114
- package/package.json +22 -13
- package/src/components/ActivityList.tsx +15 -4
- package/src/components/AddFundsSheet.tsx +34 -14
- package/src/components/BalanceHero.tsx +17 -5
- package/src/components/CurrencyCombobox.tsx +13 -3
- package/src/components/PaymentSheet.tsx +72 -29
- package/src/components/WithdrawSheet.tsx +36 -15
- package/src/components/WithdrawalSheet.tsx +75 -32
- package/src/i18n/index.ts +26 -0
- package/src/i18n/locales/en.ts +136 -0
- package/src/i18n/locales/ko.ts +136 -0
- package/src/i18n/locales/ru.ts +136 -0
- package/src/i18n/types.ts +169 -0
- package/src/i18n/usePaymentsT.ts +60 -0
package/dist/index.cjs
CHANGED
|
@@ -8,6 +8,7 @@ var zod = require('zod');
|
|
|
8
8
|
var useSWR = require('swr');
|
|
9
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
10
|
var lucideReact = require('lucide-react');
|
|
11
|
+
var nextIntl = require('next-intl');
|
|
11
12
|
var uiCore = require('@djangocfg/ui-core');
|
|
12
13
|
var lib = require('@djangocfg/ui-core/lib');
|
|
13
14
|
var moment3 = require('moment');
|
|
@@ -2053,8 +2054,411 @@ function mapWithdrawalStatus(status) {
|
|
|
2053
2054
|
return "pending";
|
|
2054
2055
|
}
|
|
2055
2056
|
}
|
|
2057
|
+
|
|
2058
|
+
// src/i18n/locales/en.ts
|
|
2059
|
+
var en = {
|
|
2060
|
+
balance: {
|
|
2061
|
+
available: "Available Balance",
|
|
2062
|
+
totalDeposited: "Total Deposited",
|
|
2063
|
+
totalWithdrawn: "Total Withdrawn"
|
|
2064
|
+
},
|
|
2065
|
+
actions: {
|
|
2066
|
+
addFunds: "Add Funds",
|
|
2067
|
+
withdraw: "Withdraw",
|
|
2068
|
+
continue: "Continue",
|
|
2069
|
+
requestWithdrawal: "Request Withdrawal",
|
|
2070
|
+
cancel: "Cancel",
|
|
2071
|
+
close: "Close",
|
|
2072
|
+
copyAddress: "Copy Address",
|
|
2073
|
+
copied: "Copied!",
|
|
2074
|
+
viewAll: "View All",
|
|
2075
|
+
tryAgain: "Try Again",
|
|
2076
|
+
refreshStatus: "Refresh Status",
|
|
2077
|
+
createNewPayment: "Create New Payment",
|
|
2078
|
+
openInPaymentProvider: "Open in Payment Provider"
|
|
2079
|
+
},
|
|
2080
|
+
paymentStatus: {
|
|
2081
|
+
waiting: "Waiting for payment",
|
|
2082
|
+
confirming: "Confirming",
|
|
2083
|
+
completed: "Completed",
|
|
2084
|
+
failed: "Failed",
|
|
2085
|
+
expired: "Expired",
|
|
2086
|
+
paymentExpired: "Payment Expired"
|
|
2087
|
+
},
|
|
2088
|
+
withdrawalStatus: {
|
|
2089
|
+
pending: "Pending Approval",
|
|
2090
|
+
approved: "Approved",
|
|
2091
|
+
processing: "Processing",
|
|
2092
|
+
completed: "Completed",
|
|
2093
|
+
rejected: "Rejected",
|
|
2094
|
+
cancelled: "Cancelled"
|
|
2095
|
+
},
|
|
2096
|
+
paymentDescriptions: {
|
|
2097
|
+
sendCrypto: "Send cryptocurrency to complete payment",
|
|
2098
|
+
expired: "This payment has expired",
|
|
2099
|
+
completed: "Payment completed successfully",
|
|
2100
|
+
failed: "Payment failed",
|
|
2101
|
+
confirming: "Confirming your payment",
|
|
2102
|
+
createNew: "Please create a new payment to continue"
|
|
2103
|
+
},
|
|
2104
|
+
withdrawalDescriptions: {
|
|
2105
|
+
pendingApproval: "Waiting for admin approval",
|
|
2106
|
+
processing: "Your withdrawal is being processed",
|
|
2107
|
+
completed: "Withdrawal completed successfully",
|
|
2108
|
+
rejected: "Withdrawal was rejected",
|
|
2109
|
+
cancelled: "Withdrawal was cancelled"
|
|
2110
|
+
},
|
|
2111
|
+
form: {
|
|
2112
|
+
amount: "Amount",
|
|
2113
|
+
amountUsd: "Amount (USD)",
|
|
2114
|
+
currency: "Currency",
|
|
2115
|
+
walletAddress: "Wallet Address",
|
|
2116
|
+
selectCurrency: "Select currency...",
|
|
2117
|
+
enterWalletAddress: "Enter your wallet address",
|
|
2118
|
+
search: "Search...",
|
|
2119
|
+
payWith: "Pay with",
|
|
2120
|
+
withdrawAs: "Withdraw as",
|
|
2121
|
+
amountToSend: "Amount to send",
|
|
2122
|
+
equivalent: "Equivalent",
|
|
2123
|
+
network: "Network",
|
|
2124
|
+
paymentAddress: "Payment Address",
|
|
2125
|
+
transactionHash: "Transaction Hash",
|
|
2126
|
+
paymentId: "Payment ID",
|
|
2127
|
+
orderId: "Order #",
|
|
2128
|
+
created: "Created"
|
|
2129
|
+
},
|
|
2130
|
+
validation: {
|
|
2131
|
+
minimumDeposit: "Minimum $1",
|
|
2132
|
+
minimumWithdrawal: "Minimum $10",
|
|
2133
|
+
selectCurrency: "Select a currency",
|
|
2134
|
+
invalidWalletAddress: "Invalid wallet address"
|
|
2135
|
+
},
|
|
2136
|
+
messages: {
|
|
2137
|
+
paymentCreated: "Payment created successfully",
|
|
2138
|
+
paymentFailed: "Failed to create payment",
|
|
2139
|
+
withdrawalCreated: "Withdrawal request created",
|
|
2140
|
+
withdrawalFailed: "Failed to create withdrawal request",
|
|
2141
|
+
withdrawalCancelled: "Withdrawal cancelled",
|
|
2142
|
+
addressCopied: "Address copied to clipboard",
|
|
2143
|
+
failedToLoadPayment: "Failed to load payment",
|
|
2144
|
+
failedToCreateWithdrawal: "Failed to create withdrawal request"
|
|
2145
|
+
},
|
|
2146
|
+
sheets: {
|
|
2147
|
+
addFundsTitle: "Add Funds",
|
|
2148
|
+
addFundsDescription: "Add funds to your wallet using cryptocurrency",
|
|
2149
|
+
withdrawTitle: "Withdraw",
|
|
2150
|
+
withdrawDescription: "Withdraw funds to your cryptocurrency wallet",
|
|
2151
|
+
paymentTitle: "Payment Details",
|
|
2152
|
+
withdrawalTitle: "Withdrawal Details"
|
|
2153
|
+
},
|
|
2154
|
+
activity: {
|
|
2155
|
+
title: "Recent Activity",
|
|
2156
|
+
noActivity: "No Activity Yet",
|
|
2157
|
+
deposit: "Deposit",
|
|
2158
|
+
withdrawal: "Withdrawal",
|
|
2159
|
+
payment: "Payment",
|
|
2160
|
+
transactionsWillAppear: "Your transactions will appear here"
|
|
2161
|
+
},
|
|
2162
|
+
estimate: {
|
|
2163
|
+
gettingRate: "Getting rate...",
|
|
2164
|
+
calculating: "Calculating fees...",
|
|
2165
|
+
enterAmountToSee: "Enter amount to see conversion",
|
|
2166
|
+
youWillSend: "You will send",
|
|
2167
|
+
youWillReceive: "You will receive",
|
|
2168
|
+
serviceFee: "Service fee",
|
|
2169
|
+
networkFee: "Network fee",
|
|
2170
|
+
rate: "Rate",
|
|
2171
|
+
minimumAmount: "Minimum amount"
|
|
2172
|
+
},
|
|
2173
|
+
withdraw: {
|
|
2174
|
+
insufficientBalance: "Insufficient balance",
|
|
2175
|
+
approvalWarning: "Withdrawal requests require admin approval. Processing may take 24-48 hours.",
|
|
2176
|
+
submitting: "Submitting...",
|
|
2177
|
+
creating: "Creating...",
|
|
2178
|
+
expiresIn: "Expires in"
|
|
2179
|
+
}
|
|
2180
|
+
};
|
|
2181
|
+
|
|
2182
|
+
// src/i18n/locales/ru.ts
|
|
2183
|
+
var ru = {
|
|
2184
|
+
balance: {
|
|
2185
|
+
available: "\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0439 \u0431\u0430\u043B\u0430\u043D\u0441",
|
|
2186
|
+
totalDeposited: "\u0412\u0441\u0435\u0433\u043E \u0432\u043D\u0435\u0441\u0435\u043D\u043E",
|
|
2187
|
+
totalWithdrawn: "\u0412\u0441\u0435\u0433\u043E \u0432\u044B\u0432\u0435\u0434\u0435\u043D\u043E"
|
|
2188
|
+
},
|
|
2189
|
+
actions: {
|
|
2190
|
+
addFunds: "\u041F\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u044C",
|
|
2191
|
+
withdraw: "\u0412\u044B\u0432\u0435\u0441\u0442\u0438",
|
|
2192
|
+
continue: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C",
|
|
2193
|
+
requestWithdrawal: "\u0417\u0430\u043F\u0440\u043E\u0441\u0438\u0442\u044C \u0432\u044B\u0432\u043E\u0434",
|
|
2194
|
+
cancel: "\u041E\u0442\u043C\u0435\u043D\u0430",
|
|
2195
|
+
close: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C",
|
|
2196
|
+
copyAddress: "\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0430\u0434\u0440\u0435\u0441",
|
|
2197
|
+
copied: "\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E!",
|
|
2198
|
+
viewAll: "\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0432\u0441\u0435",
|
|
2199
|
+
tryAgain: "\u041F\u043E\u043F\u0440\u043E\u0431\u043E\u0432\u0430\u0442\u044C \u0441\u043D\u043E\u0432\u0430",
|
|
2200
|
+
refreshStatus: "\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u0442\u0430\u0442\u0443\u0441",
|
|
2201
|
+
createNewPayment: "\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u043F\u043B\u0430\u0442\u0451\u0436",
|
|
2202
|
+
openInPaymentProvider: "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0443 \u043F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440\u0430"
|
|
2203
|
+
},
|
|
2204
|
+
paymentStatus: {
|
|
2205
|
+
waiting: "\u041E\u0436\u0438\u0434\u0430\u043D\u0438\u0435 \u043E\u043F\u043B\u0430\u0442\u044B",
|
|
2206
|
+
confirming: "\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u0435",
|
|
2207
|
+
completed: "\u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E",
|
|
2208
|
+
failed: "\u041E\u0448\u0438\u0431\u043A\u0430",
|
|
2209
|
+
expired: "\u0418\u0441\u0442\u0435\u043A\u043B\u043E",
|
|
2210
|
+
paymentExpired: "\u041F\u043B\u0430\u0442\u0451\u0436 \u0438\u0441\u0442\u0451\u043A"
|
|
2211
|
+
},
|
|
2212
|
+
withdrawalStatus: {
|
|
2213
|
+
pending: "\u041E\u0436\u0438\u0434\u0430\u0435\u0442 \u043E\u0434\u043E\u0431\u0440\u0435\u043D\u0438\u044F",
|
|
2214
|
+
approved: "\u041E\u0434\u043E\u0431\u0440\u0435\u043D\u043E",
|
|
2215
|
+
processing: "\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430",
|
|
2216
|
+
completed: "\u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E",
|
|
2217
|
+
rejected: "\u041E\u0442\u043A\u043B\u043E\u043D\u0435\u043D\u043E",
|
|
2218
|
+
cancelled: "\u041E\u0442\u043C\u0435\u043D\u0435\u043D\u043E"
|
|
2219
|
+
},
|
|
2220
|
+
paymentDescriptions: {
|
|
2221
|
+
sendCrypto: "\u041E\u0442\u043F\u0440\u0430\u0432\u044C\u0442\u0435 \u043A\u0440\u0438\u043F\u0442\u043E\u0432\u0430\u043B\u044E\u0442\u0443 \u0434\u043B\u044F \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u0438\u044F \u043F\u043B\u0430\u0442\u0435\u0436\u0430",
|
|
2222
|
+
expired: "\u0421\u0440\u043E\u043A \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u043F\u043B\u0430\u0442\u0435\u0436\u0430 \u0438\u0441\u0442\u0451\u043A",
|
|
2223
|
+
completed: "\u041F\u043B\u0430\u0442\u0451\u0436 \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043D",
|
|
2224
|
+
failed: "\u041F\u043B\u0430\u0442\u0451\u0436 \u043D\u0435 \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D",
|
|
2225
|
+
confirming: "\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u0435 \u043F\u043B\u0430\u0442\u0435\u0436\u0430",
|
|
2226
|
+
createNew: "\u0421\u043E\u0437\u0434\u0430\u0439\u0442\u0435 \u043D\u043E\u0432\u044B\u0439 \u043F\u043B\u0430\u0442\u0451\u0436 \u0434\u043B\u044F \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0435\u043D\u0438\u044F"
|
|
2227
|
+
},
|
|
2228
|
+
withdrawalDescriptions: {
|
|
2229
|
+
pendingApproval: "\u041E\u0436\u0438\u0434\u0430\u043D\u0438\u0435 \u043E\u0434\u043E\u0431\u0440\u0435\u043D\u0438\u044F \u0430\u0434\u043C\u0438\u043D\u0438\u0441\u0442\u0440\u0430\u0442\u043E\u0440\u0430",
|
|
2230
|
+
processing: "\u0412\u0430\u0448 \u0432\u044B\u0432\u043E\u0434 \u043E\u0431\u0440\u0430\u0431\u0430\u0442\u044B\u0432\u0430\u0435\u0442\u0441\u044F",
|
|
2231
|
+
completed: "\u0412\u044B\u0432\u043E\u0434 \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043D",
|
|
2232
|
+
rejected: "\u0412\u044B\u0432\u043E\u0434 \u0431\u044B\u043B \u043E\u0442\u043A\u043B\u043E\u043D\u0451\u043D",
|
|
2233
|
+
cancelled: "\u0412\u044B\u0432\u043E\u0434 \u0431\u044B\u043B \u043E\u0442\u043C\u0435\u043D\u0451\u043D"
|
|
2234
|
+
},
|
|
2235
|
+
form: {
|
|
2236
|
+
amount: "\u0421\u0443\u043C\u043C\u0430",
|
|
2237
|
+
amountUsd: "\u0421\u0443\u043C\u043C\u0430 (USD)",
|
|
2238
|
+
currency: "\u0412\u0430\u043B\u044E\u0442\u0430",
|
|
2239
|
+
walletAddress: "\u0410\u0434\u0440\u0435\u0441 \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0430",
|
|
2240
|
+
selectCurrency: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u043B\u044E\u0442\u0443...",
|
|
2241
|
+
enterWalletAddress: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441 \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0430",
|
|
2242
|
+
search: "\u041F\u043E\u0438\u0441\u043A...",
|
|
2243
|
+
payWith: "\u041E\u043F\u043B\u0430\u0442\u0438\u0442\u044C \u0441 \u043F\u043E\u043C\u043E\u0449\u044C\u044E",
|
|
2244
|
+
withdrawAs: "\u0412\u044B\u0432\u0435\u0441\u0442\u0438 \u043A\u0430\u043A",
|
|
2245
|
+
amountToSend: "\u0421\u0443\u043C\u043C\u0430 \u043A \u043E\u0442\u043F\u0440\u0430\u0432\u043A\u0435",
|
|
2246
|
+
equivalent: "\u042D\u043A\u0432\u0438\u0432\u0430\u043B\u0435\u043D\u0442",
|
|
2247
|
+
network: "\u0421\u0435\u0442\u044C",
|
|
2248
|
+
paymentAddress: "\u0410\u0434\u0440\u0435\u0441 \u0434\u043B\u044F \u043E\u043F\u043B\u0430\u0442\u044B",
|
|
2249
|
+
transactionHash: "\u0425\u0435\u0448 \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0438",
|
|
2250
|
+
paymentId: "ID \u043F\u043B\u0430\u0442\u0435\u0436\u0430",
|
|
2251
|
+
orderId: "\u0417\u0430\u043A\u0430\u0437 \u2116",
|
|
2252
|
+
created: "\u0421\u043E\u0437\u0434\u0430\u043D\u043E"
|
|
2253
|
+
},
|
|
2254
|
+
validation: {
|
|
2255
|
+
minimumDeposit: "\u041C\u0438\u043D\u0438\u043C\u0443\u043C $1",
|
|
2256
|
+
minimumWithdrawal: "\u041C\u0438\u043D\u0438\u043C\u0443\u043C $10",
|
|
2257
|
+
selectCurrency: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u043B\u044E\u0442\u0443",
|
|
2258
|
+
invalidWalletAddress: "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0430\u0434\u0440\u0435\u0441 \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0430"
|
|
2259
|
+
},
|
|
2260
|
+
messages: {
|
|
2261
|
+
paymentCreated: "\u041F\u043B\u0430\u0442\u0451\u0436 \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0441\u043E\u0437\u0434\u0430\u043D",
|
|
2262
|
+
paymentFailed: "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u043F\u043B\u0430\u0442\u0451\u0436",
|
|
2263
|
+
withdrawalCreated: "\u0417\u0430\u043F\u0440\u043E\u0441 \u043D\u0430 \u0432\u044B\u0432\u043E\u0434 \u0441\u043E\u0437\u0434\u0430\u043D",
|
|
2264
|
+
withdrawalFailed: "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0437\u0430\u043F\u0440\u043E\u0441 \u043D\u0430 \u0432\u044B\u0432\u043E\u0434",
|
|
2265
|
+
withdrawalCancelled: "\u0412\u044B\u0432\u043E\u0434 \u043E\u0442\u043C\u0435\u043D\u0451\u043D",
|
|
2266
|
+
addressCopied: "\u0410\u0434\u0440\u0435\u0441 \u0441\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D",
|
|
2267
|
+
failedToLoadPayment: "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u043F\u043B\u0430\u0442\u0451\u0436",
|
|
2268
|
+
failedToCreateWithdrawal: "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0437\u0430\u043F\u0440\u043E\u0441 \u043D\u0430 \u0432\u044B\u0432\u043E\u0434"
|
|
2269
|
+
},
|
|
2270
|
+
sheets: {
|
|
2271
|
+
addFundsTitle: "\u041F\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435",
|
|
2272
|
+
addFundsDescription: "\u041F\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435 \u043A\u043E\u0448\u0435\u043B\u0451\u043A \u0441 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u043A\u0440\u0438\u043F\u0442\u043E\u0432\u0430\u043B\u044E\u0442\u044B",
|
|
2273
|
+
withdrawTitle: "\u0412\u044B\u0432\u043E\u0434",
|
|
2274
|
+
withdrawDescription: "\u0412\u044B\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u043D\u0430 \u043A\u0440\u0438\u043F\u0442\u043E\u0432\u0430\u043B\u044E\u0442\u043D\u044B\u0439 \u043A\u043E\u0448\u0435\u043B\u0451\u043A",
|
|
2275
|
+
paymentTitle: "\u0414\u0435\u0442\u0430\u043B\u0438 \u043F\u043B\u0430\u0442\u0435\u0436\u0430",
|
|
2276
|
+
withdrawalTitle: "\u0414\u0435\u0442\u0430\u043B\u0438 \u0432\u044B\u0432\u043E\u0434\u0430"
|
|
2277
|
+
},
|
|
2278
|
+
activity: {
|
|
2279
|
+
title: "\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u044F\u044F \u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442\u044C",
|
|
2280
|
+
noActivity: "\u041D\u0435\u0442 \u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442\u0438",
|
|
2281
|
+
deposit: "\u041F\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435",
|
|
2282
|
+
withdrawal: "\u0412\u044B\u0432\u043E\u0434",
|
|
2283
|
+
payment: "\u041F\u043B\u0430\u0442\u0451\u0436",
|
|
2284
|
+
transactionsWillAppear: "\u0412\u0430\u0448\u0438 \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0438 \u043F\u043E\u044F\u0432\u044F\u0442\u0441\u044F \u0437\u0434\u0435\u0441\u044C"
|
|
2285
|
+
},
|
|
2286
|
+
estimate: {
|
|
2287
|
+
gettingRate: "\u041F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435 \u043A\u0443\u0440\u0441\u0430...",
|
|
2288
|
+
calculating: "\u0420\u0430\u0441\u0447\u0451\u0442 \u043A\u043E\u043C\u0438\u0441\u0441\u0438\u0439...",
|
|
2289
|
+
enterAmountToSee: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u0443\u043C\u043C\u0443 \u0434\u043B\u044F \u043A\u043E\u043D\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438",
|
|
2290
|
+
youWillSend: "\u0412\u044B \u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u0435",
|
|
2291
|
+
youWillReceive: "\u0412\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u0435",
|
|
2292
|
+
serviceFee: "\u041A\u043E\u043C\u0438\u0441\u0441\u0438\u044F \u0441\u0435\u0440\u0432\u0438\u0441\u0430",
|
|
2293
|
+
networkFee: "\u041A\u043E\u043C\u0438\u0441\u0441\u0438\u044F \u0441\u0435\u0442\u0438",
|
|
2294
|
+
rate: "\u041A\u0443\u0440\u0441",
|
|
2295
|
+
minimumAmount: "\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u0430\u044F \u0441\u0443\u043C\u043C\u0430"
|
|
2296
|
+
},
|
|
2297
|
+
withdraw: {
|
|
2298
|
+
insufficientBalance: "\u041D\u0435\u0434\u043E\u0441\u0442\u0430\u0442\u043E\u0447\u043D\u043E \u0441\u0440\u0435\u0434\u0441\u0442\u0432",
|
|
2299
|
+
approvalWarning: "\u0417\u0430\u043F\u0440\u043E\u0441\u044B \u043D\u0430 \u0432\u044B\u0432\u043E\u0434 \u0442\u0440\u0435\u0431\u0443\u044E\u0442 \u043E\u0434\u043E\u0431\u0440\u0435\u043D\u0438\u044F \u0430\u0434\u043C\u0438\u043D\u0438\u0441\u0442\u0440\u0430\u0442\u043E\u0440\u0430. \u041E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430 \u043C\u043E\u0436\u0435\u0442 \u0437\u0430\u043D\u044F\u0442\u044C 24-48 \u0447\u0430\u0441\u043E\u0432.",
|
|
2300
|
+
submitting: "\u041E\u0442\u043F\u0440\u0430\u0432\u043A\u0430...",
|
|
2301
|
+
creating: "\u0421\u043E\u0437\u0434\u0430\u043D\u0438\u0435...",
|
|
2302
|
+
expiresIn: "\u0418\u0441\u0442\u0435\u043A\u0430\u0435\u0442 \u0447\u0435\u0440\u0435\u0437"
|
|
2303
|
+
}
|
|
2304
|
+
};
|
|
2305
|
+
|
|
2306
|
+
// src/i18n/locales/ko.ts
|
|
2307
|
+
var ko = {
|
|
2308
|
+
balance: {
|
|
2309
|
+
available: "\uC0AC\uC6A9 \uAC00\uB2A5 \uC794\uC561",
|
|
2310
|
+
totalDeposited: "\uCD1D \uC785\uAE08\uC561",
|
|
2311
|
+
totalWithdrawn: "\uCD1D \uCD9C\uAE08\uC561"
|
|
2312
|
+
},
|
|
2313
|
+
actions: {
|
|
2314
|
+
addFunds: "\uC785\uAE08\uD558\uAE30",
|
|
2315
|
+
withdraw: "\uCD9C\uAE08\uD558\uAE30",
|
|
2316
|
+
continue: "\uACC4\uC18D",
|
|
2317
|
+
requestWithdrawal: "\uCD9C\uAE08 \uC694\uCCAD",
|
|
2318
|
+
cancel: "\uCDE8\uC18C",
|
|
2319
|
+
close: "\uB2EB\uAE30",
|
|
2320
|
+
copyAddress: "\uC8FC\uC18C \uBCF5\uC0AC",
|
|
2321
|
+
copied: "\uBCF5\uC0AC\uB428!",
|
|
2322
|
+
viewAll: "\uC804\uCCB4 \uBCF4\uAE30",
|
|
2323
|
+
tryAgain: "\uB2E4\uC2DC \uC2DC\uB3C4",
|
|
2324
|
+
refreshStatus: "\uC0C1\uD0DC \uC0C8\uB85C\uACE0\uCE68",
|
|
2325
|
+
createNewPayment: "\uC0C8 \uACB0\uC81C \uB9CC\uB4E4\uAE30",
|
|
2326
|
+
openInPaymentProvider: "\uACB0\uC81C \uC81C\uACF5\uC5C5\uCCB4\uC5D0\uC11C \uC5F4\uAE30"
|
|
2327
|
+
},
|
|
2328
|
+
paymentStatus: {
|
|
2329
|
+
waiting: "\uACB0\uC81C \uB300\uAE30 \uC911",
|
|
2330
|
+
confirming: "\uD655\uC778 \uC911",
|
|
2331
|
+
completed: "\uC644\uB8CC",
|
|
2332
|
+
failed: "\uC2E4\uD328",
|
|
2333
|
+
expired: "\uB9CC\uB8CC\uB428",
|
|
2334
|
+
paymentExpired: "\uACB0\uC81C \uB9CC\uB8CC\uB428"
|
|
2335
|
+
},
|
|
2336
|
+
withdrawalStatus: {
|
|
2337
|
+
pending: "\uC2B9\uC778 \uB300\uAE30 \uC911",
|
|
2338
|
+
approved: "\uC2B9\uC778\uB428",
|
|
2339
|
+
processing: "\uCC98\uB9AC \uC911",
|
|
2340
|
+
completed: "\uC644\uB8CC",
|
|
2341
|
+
rejected: "\uAC70\uBD80\uB428",
|
|
2342
|
+
cancelled: "\uCDE8\uC18C\uB428"
|
|
2343
|
+
},
|
|
2344
|
+
paymentDescriptions: {
|
|
2345
|
+
sendCrypto: "\uACB0\uC81C\uB97C \uC644\uB8CC\uD558\uB824\uBA74 \uC554\uD638\uD654\uD3D0\uB97C \uBCF4\uB0B4\uC138\uC694",
|
|
2346
|
+
expired: "\uC774 \uACB0\uC81C\uAC00 \uB9CC\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4",
|
|
2347
|
+
completed: "\uACB0\uC81C\uAC00 \uC644\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4",
|
|
2348
|
+
failed: "\uACB0\uC81C\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4",
|
|
2349
|
+
confirming: "\uACB0\uC81C \uD655\uC778 \uC911",
|
|
2350
|
+
createNew: "\uACC4\uC18D\uD558\uB824\uBA74 \uC0C8 \uACB0\uC81C\uB97C \uC0DD\uC131\uD558\uC138\uC694"
|
|
2351
|
+
},
|
|
2352
|
+
withdrawalDescriptions: {
|
|
2353
|
+
pendingApproval: "\uAD00\uB9AC\uC790 \uC2B9\uC778 \uB300\uAE30 \uC911",
|
|
2354
|
+
processing: "\uCD9C\uAE08\uC774 \uCC98\uB9AC\uB418\uACE0 \uC788\uC2B5\uB2C8\uB2E4",
|
|
2355
|
+
completed: "\uCD9C\uAE08\uC774 \uC644\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4",
|
|
2356
|
+
rejected: "\uCD9C\uAE08\uC774 \uAC70\uBD80\uB418\uC5C8\uC2B5\uB2C8\uB2E4",
|
|
2357
|
+
cancelled: "\uCD9C\uAE08\uC774 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4"
|
|
2358
|
+
},
|
|
2359
|
+
form: {
|
|
2360
|
+
amount: "\uAE08\uC561",
|
|
2361
|
+
amountUsd: "\uAE08\uC561 (USD)",
|
|
2362
|
+
currency: "\uD1B5\uD654",
|
|
2363
|
+
walletAddress: "\uC9C0\uAC11 \uC8FC\uC18C",
|
|
2364
|
+
selectCurrency: "\uD1B5\uD654 \uC120\uD0DD...",
|
|
2365
|
+
enterWalletAddress: "\uC9C0\uAC11 \uC8FC\uC18C \uC785\uB825",
|
|
2366
|
+
search: "\uAC80\uC0C9...",
|
|
2367
|
+
payWith: "\uACB0\uC81C \uC218\uB2E8",
|
|
2368
|
+
withdrawAs: "\uCD9C\uAE08 \uD1B5\uD654",
|
|
2369
|
+
amountToSend: "\uBCF4\uB0BC \uAE08\uC561",
|
|
2370
|
+
equivalent: "\uD658\uC0B0 \uAE08\uC561",
|
|
2371
|
+
network: "\uB124\uD2B8\uC6CC\uD06C",
|
|
2372
|
+
paymentAddress: "\uACB0\uC81C \uC8FC\uC18C",
|
|
2373
|
+
transactionHash: "\uAC70\uB798 \uD574\uC2DC",
|
|
2374
|
+
paymentId: "\uACB0\uC81C ID",
|
|
2375
|
+
orderId: "\uC8FC\uBB38 #",
|
|
2376
|
+
created: "\uC0DD\uC131\uC77C"
|
|
2377
|
+
},
|
|
2378
|
+
validation: {
|
|
2379
|
+
minimumDeposit: "\uCD5C\uC18C $1",
|
|
2380
|
+
minimumWithdrawal: "\uCD5C\uC18C $10",
|
|
2381
|
+
selectCurrency: "\uD1B5\uD654\uB97C \uC120\uD0DD\uD558\uC138\uC694",
|
|
2382
|
+
invalidWalletAddress: "\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 \uC9C0\uAC11 \uC8FC\uC18C"
|
|
2383
|
+
},
|
|
2384
|
+
messages: {
|
|
2385
|
+
paymentCreated: "\uACB0\uC81C\uAC00 \uC0DD\uC131\uB418\uC5C8\uC2B5\uB2C8\uB2E4",
|
|
2386
|
+
paymentFailed: "\uACB0\uC81C \uC0DD\uC131\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4",
|
|
2387
|
+
withdrawalCreated: "\uCD9C\uAE08 \uC694\uCCAD\uC774 \uC0DD\uC131\uB418\uC5C8\uC2B5\uB2C8\uB2E4",
|
|
2388
|
+
withdrawalFailed: "\uCD9C\uAE08 \uC694\uCCAD \uC0DD\uC131\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4",
|
|
2389
|
+
withdrawalCancelled: "\uCD9C\uAE08\uC774 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4",
|
|
2390
|
+
addressCopied: "\uC8FC\uC18C\uAC00 \uD074\uB9BD\uBCF4\uB4DC\uC5D0 \uBCF5\uC0AC\uB418\uC5C8\uC2B5\uB2C8\uB2E4",
|
|
2391
|
+
failedToLoadPayment: "\uACB0\uC81C\uB97C \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4",
|
|
2392
|
+
failedToCreateWithdrawal: "\uCD9C\uAE08 \uC694\uCCAD\uC744 \uC0DD\uC131\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4"
|
|
2393
|
+
},
|
|
2394
|
+
sheets: {
|
|
2395
|
+
addFundsTitle: "\uC785\uAE08",
|
|
2396
|
+
addFundsDescription: "\uC554\uD638\uD654\uD3D0\uB85C \uC9C0\uAC11\uC744 \uCDA9\uC804\uD558\uC138\uC694",
|
|
2397
|
+
withdrawTitle: "\uCD9C\uAE08",
|
|
2398
|
+
withdrawDescription: "\uC554\uD638\uD654\uD3D0 \uC9C0\uAC11\uC73C\uB85C \uC790\uAE08\uC744 \uCD9C\uAE08\uD558\uC138\uC694",
|
|
2399
|
+
paymentTitle: "\uACB0\uC81C \uC0C1\uC138",
|
|
2400
|
+
withdrawalTitle: "\uCD9C\uAE08 \uC0C1\uC138"
|
|
2401
|
+
},
|
|
2402
|
+
activity: {
|
|
2403
|
+
title: "\uCD5C\uADFC \uD65C\uB3D9",
|
|
2404
|
+
noActivity: "\uD65C\uB3D9 \uC5C6\uC74C",
|
|
2405
|
+
deposit: "\uC785\uAE08",
|
|
2406
|
+
withdrawal: "\uCD9C\uAE08",
|
|
2407
|
+
payment: "\uACB0\uC81C",
|
|
2408
|
+
transactionsWillAppear: "\uAC70\uB798 \uB0B4\uC5ED\uC774 \uC5EC\uAE30\uC5D0 \uD45C\uC2DC\uB429\uB2C8\uB2E4"
|
|
2409
|
+
},
|
|
2410
|
+
estimate: {
|
|
2411
|
+
gettingRate: "\uD658\uC728 \uC870\uD68C \uC911...",
|
|
2412
|
+
calculating: "\uC218\uC218\uB8CC \uACC4\uC0B0 \uC911...",
|
|
2413
|
+
enterAmountToSee: "\uAE08\uC561\uC744 \uC785\uB825\uD558\uC5EC \uD658\uC0B0\uC744 \uD655\uC778\uD558\uC138\uC694",
|
|
2414
|
+
youWillSend: "\uBCF4\uB0BC \uAE08\uC561",
|
|
2415
|
+
youWillReceive: "\uBC1B\uC744 \uAE08\uC561",
|
|
2416
|
+
serviceFee: "\uC11C\uBE44\uC2A4 \uC218\uC218\uB8CC",
|
|
2417
|
+
networkFee: "\uB124\uD2B8\uC6CC\uD06C \uC218\uC218\uB8CC",
|
|
2418
|
+
rate: "\uD658\uC728",
|
|
2419
|
+
minimumAmount: "\uCD5C\uC18C \uAE08\uC561"
|
|
2420
|
+
},
|
|
2421
|
+
withdraw: {
|
|
2422
|
+
insufficientBalance: "\uC794\uC561 \uBD80\uC871",
|
|
2423
|
+
approvalWarning: "\uCD9C\uAE08 \uC694\uCCAD\uC740 \uAD00\uB9AC\uC790 \uC2B9\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. \uCC98\uB9AC\uC5D0 24-48\uC2DC\uAC04\uC774 \uC18C\uC694\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4.",
|
|
2424
|
+
submitting: "\uC81C\uCD9C \uC911...",
|
|
2425
|
+
creating: "\uC0DD\uC131 \uC911...",
|
|
2426
|
+
expiresIn: "\uB9CC\uB8CC\uAE4C\uC9C0"
|
|
2427
|
+
}
|
|
2428
|
+
};
|
|
2429
|
+
|
|
2430
|
+
// src/i18n/usePaymentsT.ts
|
|
2431
|
+
var translations = { en, ru, ko };
|
|
2432
|
+
function getNestedValue(obj, path) {
|
|
2433
|
+
const keys = path.split(".");
|
|
2434
|
+
let result = obj;
|
|
2435
|
+
for (const key of keys) {
|
|
2436
|
+
if (result && typeof result === "object" && key in result) {
|
|
2437
|
+
result = result[key];
|
|
2438
|
+
} else {
|
|
2439
|
+
return path;
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
return typeof result === "string" ? result : path;
|
|
2443
|
+
}
|
|
2444
|
+
function usePaymentsT() {
|
|
2445
|
+
const locale = nextIntl.useLocale();
|
|
2446
|
+
const t = react.useMemo(() => translations[locale] || translations.en, [locale]);
|
|
2447
|
+
return react.useCallback(
|
|
2448
|
+
(key) => getNestedValue(t, key),
|
|
2449
|
+
[t]
|
|
2450
|
+
);
|
|
2451
|
+
}
|
|
2056
2452
|
function BalanceHero({ onAddFunds, onWithdraw, className }) {
|
|
2453
|
+
const pt = usePaymentsT();
|
|
2057
2454
|
const { balance, balanceAmount, isLoadingBalance, refreshWallet } = useWallet();
|
|
2455
|
+
const labels = react.useMemo(() => ({
|
|
2456
|
+
available: pt("balance.available"),
|
|
2457
|
+
totalDeposited: pt("balance.totalDeposited"),
|
|
2458
|
+
totalWithdrawn: pt("balance.totalWithdrawn"),
|
|
2459
|
+
addFunds: pt("actions.addFunds"),
|
|
2460
|
+
withdraw: pt("actions.withdraw")
|
|
2461
|
+
}), [pt]);
|
|
2058
2462
|
const formattedBalance = new Intl.NumberFormat("en-US", {
|
|
2059
2463
|
style: "currency",
|
|
2060
2464
|
currency: "USD",
|
|
@@ -2067,7 +2471,7 @@ function BalanceHero({ onAddFunds, onWithdraw, className }) {
|
|
|
2067
2471
|
/* @__PURE__ */ jsxRuntime.jsx(uiCore.Skeleton, { className: "h-4 w-24 mx-auto" })
|
|
2068
2472
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2069
2473
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-5xl font-bold tracking-tight tabular-nums", children: formattedBalance }),
|
|
2070
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground mt-1", children:
|
|
2474
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground mt-1", children: labels.available })
|
|
2071
2475
|
] }) }),
|
|
2072
2476
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
2073
2477
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2078,7 +2482,7 @@ function BalanceHero({ onAddFunds, onWithdraw, className }) {
|
|
|
2078
2482
|
className: "rounded-full px-6",
|
|
2079
2483
|
children: [
|
|
2080
2484
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-5 w-5 mr-2" }),
|
|
2081
|
-
|
|
2485
|
+
labels.addFunds
|
|
2082
2486
|
]
|
|
2083
2487
|
}
|
|
2084
2488
|
),
|
|
@@ -2091,7 +2495,7 @@ function BalanceHero({ onAddFunds, onWithdraw, className }) {
|
|
|
2091
2495
|
className: "rounded-full px-6",
|
|
2092
2496
|
children: [
|
|
2093
2497
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUpRight, { className: "h-5 w-5 mr-2" }),
|
|
2094
|
-
|
|
2498
|
+
labels.withdraw
|
|
2095
2499
|
]
|
|
2096
2500
|
}
|
|
2097
2501
|
),
|
|
@@ -2112,7 +2516,7 @@ function BalanceHero({ onAddFunds, onWithdraw, className }) {
|
|
|
2112
2516
|
"$",
|
|
2113
2517
|
parseFloat(balance.total_deposited || "0").toFixed(2)
|
|
2114
2518
|
] }),
|
|
2115
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children:
|
|
2519
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: labels.totalDeposited })
|
|
2116
2520
|
] }),
|
|
2117
2521
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 w-px bg-border" }),
|
|
2118
2522
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
|
|
@@ -2120,7 +2524,7 @@ function BalanceHero({ onAddFunds, onWithdraw, className }) {
|
|
|
2120
2524
|
"$",
|
|
2121
2525
|
parseFloat(balance.total_withdrawn || "0").toFixed(2)
|
|
2122
2526
|
] }),
|
|
2123
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children:
|
|
2527
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: labels.totalWithdrawn })
|
|
2124
2528
|
] })
|
|
2125
2529
|
] })
|
|
2126
2530
|
] });
|
|
@@ -2207,7 +2611,14 @@ function ActivityList({
|
|
|
2207
2611
|
limit = 10,
|
|
2208
2612
|
className
|
|
2209
2613
|
}) {
|
|
2614
|
+
const pt = usePaymentsT();
|
|
2210
2615
|
const { activity, isLoadingActivity, hasMoreActivity } = useWallet();
|
|
2616
|
+
const labels = react.useMemo(() => ({
|
|
2617
|
+
title: pt("activity.title"),
|
|
2618
|
+
noActivity: pt("activity.noActivity"),
|
|
2619
|
+
transactionsWillAppear: pt("activity.transactionsWillAppear"),
|
|
2620
|
+
viewAll: pt("actions.viewAll")
|
|
2621
|
+
}), [pt]);
|
|
2211
2622
|
const displayedActivity = limit ? activity.slice(0, limit) : activity;
|
|
2212
2623
|
if (isLoadingActivity) {
|
|
2213
2624
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: lib.cn("space-y-2", className), children: [
|
|
@@ -2225,15 +2636,15 @@ function ActivityList({
|
|
|
2225
2636
|
if (activity.length === 0) {
|
|
2226
2637
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: lib.cn("text-center py-12", className), children: [
|
|
2227
2638
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "inline-flex items-center justify-center w-16 h-16 rounded-full bg-muted mb-4", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.History, { className: "h-8 w-8 text-muted-foreground" }) }),
|
|
2228
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-1", children:
|
|
2229
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children:
|
|
2639
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-1", children: labels.noActivity }),
|
|
2640
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: labels.transactionsWillAppear })
|
|
2230
2641
|
] });
|
|
2231
2642
|
}
|
|
2232
2643
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: lib.cn("pt-6", className), children: [
|
|
2233
2644
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-4 py-2", children: [
|
|
2234
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "font-semibold text-lg", children:
|
|
2645
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "font-semibold text-lg", children: labels.title }),
|
|
2235
2646
|
hasMoreActivity && onViewAll && /* @__PURE__ */ jsxRuntime.jsxs(uiCore.Button, { variant: "ghost", size: "sm", onClick: onViewAll, className: "text-primary", children: [
|
|
2236
|
-
|
|
2647
|
+
labels.viewAll,
|
|
2237
2648
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4 ml-1" })
|
|
2238
2649
|
] })
|
|
2239
2650
|
] }),
|
|
@@ -2459,16 +2870,21 @@ function CurrencyCombobox({
|
|
|
2459
2870
|
value,
|
|
2460
2871
|
onChange,
|
|
2461
2872
|
disabled,
|
|
2462
|
-
placeholder
|
|
2873
|
+
placeholder
|
|
2463
2874
|
}) {
|
|
2875
|
+
const pt = usePaymentsT();
|
|
2876
|
+
const labels = react.useMemo(() => ({
|
|
2877
|
+
selectCurrency: pt("form.selectCurrency"),
|
|
2878
|
+
search: pt("form.search")
|
|
2879
|
+
}), [pt]);
|
|
2464
2880
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2465
2881
|
uiCore.Combobox,
|
|
2466
2882
|
{
|
|
2467
2883
|
options,
|
|
2468
2884
|
value,
|
|
2469
2885
|
onValueChange: onChange,
|
|
2470
|
-
placeholder,
|
|
2471
|
-
searchPlaceholder:
|
|
2886
|
+
placeholder: placeholder || labels.selectCurrency,
|
|
2887
|
+
searchPlaceholder: labels.search,
|
|
2472
2888
|
disabled,
|
|
2473
2889
|
className: "h-14",
|
|
2474
2890
|
renderOption: (option) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 flex-1", children: [
|
|
@@ -2488,9 +2904,26 @@ var AddFundsSchema = zod.z.object({
|
|
|
2488
2904
|
});
|
|
2489
2905
|
var STORAGE_KEY = "payments:addFunds";
|
|
2490
2906
|
function AddFundsSheet({ open, onOpenChange, onSuccess }) {
|
|
2907
|
+
const pt = usePaymentsT();
|
|
2491
2908
|
const { currencies, isLoadingCurrencies, addFunds } = useWallet();
|
|
2492
2909
|
const [isSubmitting, setIsSubmitting] = react.useState(false);
|
|
2493
2910
|
const [error, setError] = react.useState(null);
|
|
2911
|
+
const labels = react.useMemo(() => ({
|
|
2912
|
+
title: pt("sheets.addFundsTitle"),
|
|
2913
|
+
description: pt("sheets.addFundsDescription"),
|
|
2914
|
+
amountUsd: pt("form.amountUsd"),
|
|
2915
|
+
payWith: pt("form.payWith"),
|
|
2916
|
+
amount: pt("form.amount"),
|
|
2917
|
+
serviceFee: pt("estimate.serviceFee"),
|
|
2918
|
+
rate: pt("estimate.rate"),
|
|
2919
|
+
youWillSend: pt("estimate.youWillSend"),
|
|
2920
|
+
youWillReceive: pt("estimate.youWillReceive"),
|
|
2921
|
+
gettingRate: pt("estimate.gettingRate"),
|
|
2922
|
+
enterAmountToSee: pt("estimate.enterAmountToSee"),
|
|
2923
|
+
minimumAmount: pt("estimate.minimumAmount"),
|
|
2924
|
+
continue: pt("actions.continue"),
|
|
2925
|
+
creating: pt("withdraw.creating")
|
|
2926
|
+
}), [pt]);
|
|
2494
2927
|
const [saved, setSaved] = uiCore.useLocalStorage(STORAGE_KEY, {
|
|
2495
2928
|
currency: "",
|
|
2496
2929
|
amount: 100
|
|
@@ -2570,8 +3003,8 @@ function AddFundsSheet({ open, onOpenChange, onSuccess }) {
|
|
|
2570
3003
|
}, [form, onOpenChange, saved]);
|
|
2571
3004
|
return /* @__PURE__ */ jsxRuntime.jsx(uiCore.ResponsiveSheet, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(uiCore.ResponsiveSheetContent, { className: "sm:max-w-md", children: [
|
|
2572
3005
|
/* @__PURE__ */ jsxRuntime.jsxs(uiCore.ResponsiveSheetHeader, { children: [
|
|
2573
|
-
/* @__PURE__ */ jsxRuntime.jsx(uiCore.ResponsiveSheetTitle, { children:
|
|
2574
|
-
/* @__PURE__ */ jsxRuntime.jsx(uiCore.ResponsiveSheetDescription, { children:
|
|
3006
|
+
/* @__PURE__ */ jsxRuntime.jsx(uiCore.ResponsiveSheetTitle, { children: labels.title }),
|
|
3007
|
+
/* @__PURE__ */ jsxRuntime.jsx(uiCore.ResponsiveSheetDescription, { children: labels.description })
|
|
2575
3008
|
] }),
|
|
2576
3009
|
/* @__PURE__ */ jsxRuntime.jsx(uiCore.Form, { ...form, children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: form.handleSubmit(handleSubmit), className: "space-y-6 p-4 sm:p-0 sm:mt-4", children: [
|
|
2577
3010
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2580,7 +3013,7 @@ function AddFundsSheet({ open, onOpenChange, onSuccess }) {
|
|
|
2580
3013
|
control: form.control,
|
|
2581
3014
|
name: "amount",
|
|
2582
3015
|
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(uiCore.FormItem, { children: [
|
|
2583
|
-
/* @__PURE__ */ jsxRuntime.jsx(uiCore.FormLabel, { children:
|
|
3016
|
+
/* @__PURE__ */ jsxRuntime.jsx(uiCore.FormLabel, { children: labels.amountUsd }),
|
|
2584
3017
|
/* @__PURE__ */ jsxRuntime.jsx(uiCore.FormControl, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
2585
3018
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-4 top-1/2 -translate-y-1/2 text-muted-foreground text-lg", children: "$" }),
|
|
2586
3019
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2606,7 +3039,7 @@ function AddFundsSheet({ open, onOpenChange, onSuccess }) {
|
|
|
2606
3039
|
control: form.control,
|
|
2607
3040
|
name: "currency",
|
|
2608
3041
|
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(uiCore.FormItem, { children: [
|
|
2609
|
-
/* @__PURE__ */ jsxRuntime.jsx(uiCore.FormLabel, { children:
|
|
3042
|
+
/* @__PURE__ */ jsxRuntime.jsx(uiCore.FormLabel, { children: labels.payWith }),
|
|
2610
3043
|
/* @__PURE__ */ jsxRuntime.jsx(uiCore.FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2611
3044
|
CurrencyCombobox,
|
|
2612
3045
|
{
|
|
@@ -2622,10 +3055,10 @@ function AddFundsSheet({ open, onOpenChange, onSuccess }) {
|
|
|
2622
3055
|
),
|
|
2623
3056
|
selectedCurrency && watchedAmount >= 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-muted rounded-xl p-4 space-y-2", children: isLoadingEstimate ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center py-2", children: [
|
|
2624
3057
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-5 w-5 animate-spin text-muted-foreground" }),
|
|
2625
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2 text-sm text-muted-foreground", children:
|
|
3058
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2 text-sm text-muted-foreground", children: labels.gettingRate })
|
|
2626
3059
|
] }) : displayData ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2627
3060
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-sm", children: [
|
|
2628
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children:
|
|
3061
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: labels.amount }),
|
|
2629
3062
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
2630
3063
|
"$",
|
|
2631
3064
|
formatUsdAmount(displayData.amountToReceive)
|
|
@@ -2633,7 +3066,8 @@ function AddFundsSheet({ open, onOpenChange, onSuccess }) {
|
|
|
2633
3066
|
] }),
|
|
2634
3067
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-sm", children: [
|
|
2635
3068
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground", children: [
|
|
2636
|
-
|
|
3069
|
+
labels.serviceFee,
|
|
3070
|
+
" (",
|
|
2637
3071
|
displayData.serviceFeePercent,
|
|
2638
3072
|
"%)"
|
|
2639
3073
|
] }),
|
|
@@ -2643,7 +3077,7 @@ function AddFundsSheet({ open, onOpenChange, onSuccess }) {
|
|
|
2643
3077
|
] })
|
|
2644
3078
|
] }),
|
|
2645
3079
|
displayData.showRate && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-sm text-muted-foreground", children: [
|
|
2646
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children:
|
|
3080
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: labels.rate }),
|
|
2647
3081
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
2648
3082
|
"1 ",
|
|
2649
3083
|
displayData.token,
|
|
@@ -2652,7 +3086,7 @@ function AddFundsSheet({ open, onOpenChange, onSuccess }) {
|
|
|
2652
3086
|
] })
|
|
2653
3087
|
] }),
|
|
2654
3088
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t pt-2 mt-2", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
2655
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children:
|
|
3089
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: labels.youWillSend }),
|
|
2656
3090
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-right", children: [
|
|
2657
3091
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 justify-end", children: [
|
|
2658
3092
|
/* @__PURE__ */ jsxRuntime.jsx(uiCore.TokenIcon, { symbol: displayData.token, size: 20 }),
|
|
@@ -2669,17 +3103,18 @@ function AddFundsSheet({ open, onOpenChange, onSuccess }) {
|
|
|
2669
3103
|
] })
|
|
2670
3104
|
] }) }),
|
|
2671
3105
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-sm pt-2", children: [
|
|
2672
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children:
|
|
3106
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: labels.youWillReceive }),
|
|
2673
3107
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-medium", children: [
|
|
2674
3108
|
"$",
|
|
2675
3109
|
formatUsdAmount(displayData.amountToReceive)
|
|
2676
3110
|
] })
|
|
2677
3111
|
] }),
|
|
2678
3112
|
displayData.belowMinimum && displayData.minAmount && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm text-destructive mt-2 pt-2 border-t border-destructive/20", children: [
|
|
2679
|
-
|
|
3113
|
+
labels.minimumAmount,
|
|
3114
|
+
": $",
|
|
2680
3115
|
displayData.minAmount
|
|
2681
3116
|
] })
|
|
2682
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center text-sm text-muted-foreground py-2", children:
|
|
3117
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center text-sm text-muted-foreground py-2", children: labels.enterAmountToSee }) }),
|
|
2683
3118
|
error && /* @__PURE__ */ jsxRuntime.jsx(uiCore.Alert, { variant: "destructive", children: /* @__PURE__ */ jsxRuntime.jsx(uiCore.AlertDescription, { children: error }) }),
|
|
2684
3119
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2685
3120
|
uiCore.Button,
|
|
@@ -2690,8 +3125,8 @@ function AddFundsSheet({ open, onOpenChange, onSuccess }) {
|
|
|
2690
3125
|
disabled: isSubmitting || currencyOptions.length === 0 || isLoadingEstimate || displayData?.belowMinimum,
|
|
2691
3126
|
children: isSubmitting ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2692
3127
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCw, { className: "h-5 w-5 mr-2 animate-spin" }),
|
|
2693
|
-
|
|
2694
|
-
] }) :
|
|
3128
|
+
labels.creating
|
|
3129
|
+
] }) : labels.continue
|
|
2695
3130
|
}
|
|
2696
3131
|
)
|
|
2697
3132
|
] }) })
|
|
@@ -2704,9 +3139,27 @@ var WithdrawSchema = zod.z.object({
|
|
|
2704
3139
|
});
|
|
2705
3140
|
var STORAGE_KEY2 = "payments:withdraw";
|
|
2706
3141
|
function WithdrawSheet({ open, onOpenChange, onSuccess }) {
|
|
3142
|
+
const pt = usePaymentsT();
|
|
2707
3143
|
const { currencies, isLoadingCurrencies, withdraw, balanceAmount } = useWallet();
|
|
2708
3144
|
const [isSubmitting, setIsSubmitting] = react.useState(false);
|
|
2709
3145
|
const [error, setError] = react.useState(null);
|
|
3146
|
+
const labels = react.useMemo(() => ({
|
|
3147
|
+
title: pt("sheets.withdrawTitle"),
|
|
3148
|
+
description: pt("sheets.withdrawDescription"),
|
|
3149
|
+
amountUsd: pt("form.amountUsd"),
|
|
3150
|
+
withdrawAs: pt("form.withdrawAs"),
|
|
3151
|
+
walletAddress: pt("form.walletAddress"),
|
|
3152
|
+
enterWalletAddress: pt("form.enterWalletAddress"),
|
|
3153
|
+
amount: pt("form.amount"),
|
|
3154
|
+
serviceFee: pt("estimate.serviceFee"),
|
|
3155
|
+
networkFee: pt("estimate.networkFee"),
|
|
3156
|
+
youWillReceive: pt("estimate.youWillReceive"),
|
|
3157
|
+
calculating: pt("estimate.calculating"),
|
|
3158
|
+
insufficientBalance: pt("withdraw.insufficientBalance"),
|
|
3159
|
+
approvalWarning: pt("withdraw.approvalWarning"),
|
|
3160
|
+
submitting: pt("withdraw.submitting"),
|
|
3161
|
+
requestWithdrawal: pt("actions.requestWithdrawal")
|
|
3162
|
+
}), [pt]);
|
|
2710
3163
|
const [saved, setSaved] = uiCore.useLocalStorage(STORAGE_KEY2, {
|
|
2711
3164
|
currency: "",
|
|
2712
3165
|
wallet: ""
|
|
@@ -2779,8 +3232,8 @@ function WithdrawSheet({ open, onOpenChange, onSuccess }) {
|
|
|
2779
3232
|
}, [form, onOpenChange, saved]);
|
|
2780
3233
|
return /* @__PURE__ */ jsxRuntime.jsx(uiCore.ResponsiveSheet, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(uiCore.ResponsiveSheetContent, { className: "sm:max-w-md", children: [
|
|
2781
3234
|
/* @__PURE__ */ jsxRuntime.jsxs(uiCore.ResponsiveSheetHeader, { children: [
|
|
2782
|
-
/* @__PURE__ */ jsxRuntime.jsx(uiCore.ResponsiveSheetTitle, { children:
|
|
2783
|
-
/* @__PURE__ */ jsxRuntime.jsx(uiCore.ResponsiveSheetDescription, { children:
|
|
3235
|
+
/* @__PURE__ */ jsxRuntime.jsx(uiCore.ResponsiveSheetTitle, { children: labels.title }),
|
|
3236
|
+
/* @__PURE__ */ jsxRuntime.jsx(uiCore.ResponsiveSheetDescription, { children: labels.description })
|
|
2784
3237
|
] }),
|
|
2785
3238
|
/* @__PURE__ */ jsxRuntime.jsx(uiCore.Form, { ...form, children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: form.handleSubmit(handleSubmit), className: "space-y-6 p-4 sm:p-0 sm:mt-4", children: [
|
|
2786
3239
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2789,7 +3242,7 @@ function WithdrawSheet({ open, onOpenChange, onSuccess }) {
|
|
|
2789
3242
|
control: form.control,
|
|
2790
3243
|
name: "amount",
|
|
2791
3244
|
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(uiCore.FormItem, { children: [
|
|
2792
|
-
/* @__PURE__ */ jsxRuntime.jsx(uiCore.FormLabel, { children:
|
|
3245
|
+
/* @__PURE__ */ jsxRuntime.jsx(uiCore.FormLabel, { children: labels.amountUsd }),
|
|
2793
3246
|
/* @__PURE__ */ jsxRuntime.jsx(uiCore.FormControl, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
2794
3247
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-4 top-1/2 -translate-y-1/2 text-muted-foreground text-lg", children: "$" }),
|
|
2795
3248
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2807,7 +3260,8 @@ function WithdrawSheet({ open, onOpenChange, onSuccess }) {
|
|
|
2807
3260
|
] }) }),
|
|
2808
3261
|
/* @__PURE__ */ jsxRuntime.jsx(uiCore.FormMessage, {}),
|
|
2809
3262
|
insufficientBalance && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-destructive mt-1", children: [
|
|
2810
|
-
|
|
3263
|
+
labels.insufficientBalance,
|
|
3264
|
+
" (Available: $",
|
|
2811
3265
|
formatUsdAmount(balanceAmount),
|
|
2812
3266
|
")"
|
|
2813
3267
|
] })
|
|
@@ -2820,7 +3274,7 @@ function WithdrawSheet({ open, onOpenChange, onSuccess }) {
|
|
|
2820
3274
|
control: form.control,
|
|
2821
3275
|
name: "currency",
|
|
2822
3276
|
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(uiCore.FormItem, { children: [
|
|
2823
|
-
/* @__PURE__ */ jsxRuntime.jsx(uiCore.FormLabel, { children:
|
|
3277
|
+
/* @__PURE__ */ jsxRuntime.jsx(uiCore.FormLabel, { children: labels.withdrawAs }),
|
|
2824
3278
|
/* @__PURE__ */ jsxRuntime.jsx(uiCore.FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2825
3279
|
CurrencyCombobox,
|
|
2826
3280
|
{
|
|
@@ -2840,11 +3294,11 @@ function WithdrawSheet({ open, onOpenChange, onSuccess }) {
|
|
|
2840
3294
|
control: form.control,
|
|
2841
3295
|
name: "wallet_address",
|
|
2842
3296
|
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(uiCore.FormItem, { children: [
|
|
2843
|
-
/* @__PURE__ */ jsxRuntime.jsx(uiCore.FormLabel, { children:
|
|
3297
|
+
/* @__PURE__ */ jsxRuntime.jsx(uiCore.FormLabel, { children: labels.walletAddress }),
|
|
2844
3298
|
/* @__PURE__ */ jsxRuntime.jsx(uiCore.FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2845
3299
|
uiCore.Input,
|
|
2846
3300
|
{
|
|
2847
|
-
placeholder:
|
|
3301
|
+
placeholder: labels.enterWalletAddress,
|
|
2848
3302
|
className: "font-mono text-sm",
|
|
2849
3303
|
...field
|
|
2850
3304
|
}
|
|
@@ -2855,7 +3309,7 @@ function WithdrawSheet({ open, onOpenChange, onSuccess }) {
|
|
|
2855
3309
|
),
|
|
2856
3310
|
amount >= 10 && selectedCurrency && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-muted rounded-xl p-4 space-y-2", children: [
|
|
2857
3311
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-sm", children: [
|
|
2858
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children:
|
|
3312
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: labels.amount }),
|
|
2859
3313
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
2860
3314
|
"$",
|
|
2861
3315
|
formatUsdAmount(amount)
|
|
@@ -2863,11 +3317,12 @@ function WithdrawSheet({ open, onOpenChange, onSuccess }) {
|
|
|
2863
3317
|
] }),
|
|
2864
3318
|
isLoadingEstimate ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground py-2", children: [
|
|
2865
3319
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
2866
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children:
|
|
3320
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: labels.calculating })
|
|
2867
3321
|
] }) : estimate ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2868
3322
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-sm", children: [
|
|
2869
3323
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground", children: [
|
|
2870
|
-
|
|
3324
|
+
labels.serviceFee,
|
|
3325
|
+
" (",
|
|
2871
3326
|
estimate.serviceFeePercent,
|
|
2872
3327
|
"%)"
|
|
2873
3328
|
] }),
|
|
@@ -2877,14 +3332,14 @@ function WithdrawSheet({ open, onOpenChange, onSuccess }) {
|
|
|
2877
3332
|
] })
|
|
2878
3333
|
] }),
|
|
2879
3334
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-sm", children: [
|
|
2880
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children:
|
|
3335
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: labels.networkFee }),
|
|
2881
3336
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-destructive", children: [
|
|
2882
3337
|
"-$",
|
|
2883
3338
|
formatUsdAmount(estimate.networkFeeUsd)
|
|
2884
3339
|
] })
|
|
2885
3340
|
] }),
|
|
2886
3341
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t pt-2 mt-2", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
2887
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children:
|
|
3342
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: labels.youWillReceive }),
|
|
2888
3343
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-right", children: [
|
|
2889
3344
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "font-semibold", children: [
|
|
2890
3345
|
"$",
|
|
@@ -2904,7 +3359,7 @@ function WithdrawSheet({ open, onOpenChange, onSuccess }) {
|
|
|
2904
3359
|
] }),
|
|
2905
3360
|
/* @__PURE__ */ jsxRuntime.jsxs(uiCore.Alert, { children: [
|
|
2906
3361
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "h-4 w-4" }),
|
|
2907
|
-
/* @__PURE__ */ jsxRuntime.jsx(uiCore.AlertDescription, { children:
|
|
3362
|
+
/* @__PURE__ */ jsxRuntime.jsx(uiCore.AlertDescription, { children: labels.approvalWarning })
|
|
2908
3363
|
] }),
|
|
2909
3364
|
error && /* @__PURE__ */ jsxRuntime.jsx(uiCore.Alert, { variant: "destructive", children: /* @__PURE__ */ jsxRuntime.jsx(uiCore.AlertDescription, { children: error }) }),
|
|
2910
3365
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2916,8 +3371,8 @@ function WithdrawSheet({ open, onOpenChange, onSuccess }) {
|
|
|
2916
3371
|
disabled: isSubmitting || currencyOptions.length === 0 || insufficientBalance || !estimate || estimate.amountToReceive <= 0 || isLoadingEstimate,
|
|
2917
3372
|
children: isSubmitting ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2918
3373
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCw, { className: "h-5 w-5 mr-2 animate-spin" }),
|
|
2919
|
-
|
|
2920
|
-
] }) :
|
|
3374
|
+
labels.submitting
|
|
3375
|
+
] }) : labels.requestWithdrawal
|
|
2921
3376
|
}
|
|
2922
3377
|
)
|
|
2923
3378
|
] }) })
|
|
@@ -2927,43 +3382,72 @@ var statusConfig2 = {
|
|
|
2927
3382
|
pending: {
|
|
2928
3383
|
icon: lucideReact.Clock,
|
|
2929
3384
|
color: "text-yellow-500",
|
|
2930
|
-
bg: "bg-yellow-500/10"
|
|
2931
|
-
label: "Pending Approval"
|
|
3385
|
+
bg: "bg-yellow-500/10"
|
|
2932
3386
|
},
|
|
2933
3387
|
approved: {
|
|
2934
3388
|
icon: lucideReact.CheckCircle2,
|
|
2935
3389
|
color: "text-blue-500",
|
|
2936
|
-
bg: "bg-blue-500/10"
|
|
2937
|
-
label: "Approved"
|
|
3390
|
+
bg: "bg-blue-500/10"
|
|
2938
3391
|
},
|
|
2939
3392
|
processing: {
|
|
2940
3393
|
icon: lucideReact.RefreshCw,
|
|
2941
3394
|
color: "text-blue-500",
|
|
2942
3395
|
bg: "bg-blue-500/10",
|
|
2943
|
-
label: "Processing",
|
|
2944
3396
|
animate: true
|
|
2945
3397
|
},
|
|
2946
3398
|
completed: {
|
|
2947
3399
|
icon: lucideReact.CheckCircle2,
|
|
2948
3400
|
color: "text-green-500",
|
|
2949
|
-
bg: "bg-green-500/10"
|
|
2950
|
-
label: "Completed"
|
|
3401
|
+
bg: "bg-green-500/10"
|
|
2951
3402
|
},
|
|
2952
3403
|
rejected: {
|
|
2953
3404
|
icon: lucideReact.XCircle,
|
|
2954
3405
|
color: "text-red-500",
|
|
2955
|
-
bg: "bg-red-500/10"
|
|
2956
|
-
label: "Rejected"
|
|
3406
|
+
bg: "bg-red-500/10"
|
|
2957
3407
|
},
|
|
2958
3408
|
cancelled: {
|
|
2959
3409
|
icon: lucideReact.Ban,
|
|
2960
3410
|
color: "text-muted-foreground",
|
|
2961
|
-
bg: "bg-muted"
|
|
2962
|
-
label: "Cancelled"
|
|
3411
|
+
bg: "bg-muted"
|
|
2963
3412
|
}
|
|
2964
3413
|
};
|
|
2965
3414
|
function WithdrawalSheet({ withdrawalId, open, onOpenChange }) {
|
|
3415
|
+
const pt = usePaymentsT();
|
|
2966
3416
|
const { getWithdrawalDetails, cancelWithdrawal, refreshWallet } = useWallet();
|
|
3417
|
+
const labels = react.useMemo(() => ({
|
|
3418
|
+
title: pt("sheets.withdrawalTitle"),
|
|
3419
|
+
// Status labels
|
|
3420
|
+
pending: pt("withdrawalStatus.pending"),
|
|
3421
|
+
approved: pt("withdrawalStatus.approved"),
|
|
3422
|
+
processing: pt("withdrawalStatus.processing"),
|
|
3423
|
+
completed: pt("withdrawalStatus.completed"),
|
|
3424
|
+
rejected: pt("withdrawalStatus.rejected"),
|
|
3425
|
+
cancelled: pt("withdrawalStatus.cancelled"),
|
|
3426
|
+
// Descriptions
|
|
3427
|
+
pendingApproval: pt("withdrawalDescriptions.pendingApproval"),
|
|
3428
|
+
processingDesc: pt("withdrawalDescriptions.processing"),
|
|
3429
|
+
completedDesc: pt("withdrawalDescriptions.completed"),
|
|
3430
|
+
rejectedDesc: pt("withdrawalDescriptions.rejected"),
|
|
3431
|
+
cancelledDesc: pt("withdrawalDescriptions.cancelled"),
|
|
3432
|
+
// Form
|
|
3433
|
+
amount: pt("form.amount"),
|
|
3434
|
+
totalFees: pt("estimate.serviceFee"),
|
|
3435
|
+
youReceive: pt("estimate.youWillReceive"),
|
|
3436
|
+
cryptoAmount: pt("form.amount"),
|
|
3437
|
+
destinationWallet: pt("form.walletAddress"),
|
|
3438
|
+
transactionHash: pt("form.transactionHash"),
|
|
3439
|
+
withdrawalId: pt("form.paymentId"),
|
|
3440
|
+
reference: pt("form.orderId"),
|
|
3441
|
+
created: pt("form.created"),
|
|
3442
|
+
network: pt("form.network"),
|
|
3443
|
+
// Actions
|
|
3444
|
+
viewOnExplorer: pt("actions.openInPaymentProvider"),
|
|
3445
|
+
cancel: pt("actions.cancel"),
|
|
3446
|
+
refreshStatus: pt("actions.refreshStatus"),
|
|
3447
|
+
tryAgain: pt("actions.tryAgain"),
|
|
3448
|
+
// Messages
|
|
3449
|
+
failedToLoad: pt("messages.failedToLoadPayment")
|
|
3450
|
+
}), [pt]);
|
|
2967
3451
|
const { data: withdrawal, isLoading, error, mutate } = useSWR__default.default(
|
|
2968
3452
|
open && withdrawalId ? ["withdrawal-details", withdrawalId] : null,
|
|
2969
3453
|
() => getWithdrawalDetails(withdrawalId),
|
|
@@ -2978,12 +3462,20 @@ function WithdrawalSheet({ withdrawalId, open, onOpenChange }) {
|
|
|
2978
3462
|
const isCancelled = s === "cancelled";
|
|
2979
3463
|
const isProcessing = s === "processing" || s === "approved";
|
|
2980
3464
|
const canCancel2 = isPending;
|
|
3465
|
+
const statusLabels = {
|
|
3466
|
+
pending: labels.pending,
|
|
3467
|
+
approved: labels.approved,
|
|
3468
|
+
processing: labels.processing,
|
|
3469
|
+
completed: labels.completed,
|
|
3470
|
+
rejected: labels.rejected,
|
|
3471
|
+
cancelled: labels.cancelled
|
|
3472
|
+
};
|
|
2981
3473
|
let description2 = "";
|
|
2982
|
-
if (isPending) description2 =
|
|
2983
|
-
else if (isProcessing) description2 =
|
|
2984
|
-
else if (isCompleted) description2 =
|
|
2985
|
-
else if (isRejected) description2 =
|
|
2986
|
-
else if (isCancelled) description2 =
|
|
3474
|
+
if (isPending) description2 = labels.pendingApproval;
|
|
3475
|
+
else if (isProcessing) description2 = labels.processingDesc;
|
|
3476
|
+
else if (isCompleted) description2 = labels.completedDesc;
|
|
3477
|
+
else if (isRejected) description2 = labels.rejectedDesc;
|
|
3478
|
+
else if (isCancelled) description2 = labels.cancelledDesc;
|
|
2987
3479
|
const amountUsd2 = withdrawal?.amount_usd ? `$${parseFloat(withdrawal.amount_usd).toFixed(2)}` : "";
|
|
2988
3480
|
const finalAmountUsd2 = withdrawal?.final_amount_usd ? `$${parseFloat(withdrawal.final_amount_usd).toFixed(2)}` : "";
|
|
2989
3481
|
const totalFeeUsd2 = withdrawal?.total_fee_usd ? `$${parseFloat(withdrawal.total_fee_usd).toFixed(2)}` : "";
|
|
@@ -2992,6 +3484,7 @@ function WithdrawalSheet({ withdrawalId, open, onOpenChange }) {
|
|
|
2992
3484
|
return {
|
|
2993
3485
|
status: s,
|
|
2994
3486
|
config: config2,
|
|
3487
|
+
statusLabel: statusLabels[s] || statusLabels.pending,
|
|
2995
3488
|
isPending,
|
|
2996
3489
|
isCompleted,
|
|
2997
3490
|
isRejected,
|
|
@@ -3005,8 +3498,8 @@ function WithdrawalSheet({ withdrawalId, open, onOpenChange }) {
|
|
|
3005
3498
|
createdAt: createdAt2,
|
|
3006
3499
|
completedAt: completedAt2
|
|
3007
3500
|
};
|
|
3008
|
-
}, [withdrawal]);
|
|
3009
|
-
const { config, canCancel, description, amountUsd, finalAmountUsd, totalFeeUsd, createdAt, completedAt } = displayData;
|
|
3501
|
+
}, [withdrawal, labels]);
|
|
3502
|
+
const { config, statusLabel, canCancel, description, amountUsd, finalAmountUsd, totalFeeUsd, createdAt, completedAt } = displayData;
|
|
3010
3503
|
const StatusIcon = config.icon;
|
|
3011
3504
|
const handleCancel = async () => {
|
|
3012
3505
|
if (!withdrawalId) return;
|
|
@@ -3020,7 +3513,7 @@ function WithdrawalSheet({ withdrawalId, open, onOpenChange }) {
|
|
|
3020
3513
|
};
|
|
3021
3514
|
return /* @__PURE__ */ jsxRuntime.jsx(uiCore.ResponsiveSheet, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(uiCore.ResponsiveSheetContent, { className: "sm:max-w-lg", children: [
|
|
3022
3515
|
/* @__PURE__ */ jsxRuntime.jsxs(uiCore.ResponsiveSheetHeader, { children: [
|
|
3023
|
-
/* @__PURE__ */ jsxRuntime.jsx(uiCore.ResponsiveSheetTitle, { children:
|
|
3516
|
+
/* @__PURE__ */ jsxRuntime.jsx(uiCore.ResponsiveSheetTitle, { children: labels.title }),
|
|
3024
3517
|
/* @__PURE__ */ jsxRuntime.jsx(uiCore.ResponsiveSheetDescription, { children: description })
|
|
3025
3518
|
] }),
|
|
3026
3519
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 sm:p-0 sm:mt-4 overflow-y-auto max-h-[70vh]", children: [
|
|
@@ -3031,38 +3524,38 @@ function WithdrawalSheet({ withdrawalId, open, onOpenChange }) {
|
|
|
3031
3524
|
] }),
|
|
3032
3525
|
error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center py-12", children: [
|
|
3033
3526
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.XCircle, { className: "h-12 w-12 text-destructive mb-4" }),
|
|
3034
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mb-4", children:
|
|
3035
|
-
/* @__PURE__ */ jsxRuntime.jsx(uiCore.Button, { onClick: () => mutate(), children:
|
|
3527
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mb-4", children: labels.failedToLoad }),
|
|
3528
|
+
/* @__PURE__ */ jsxRuntime.jsx(uiCore.Button, { onClick: () => mutate(), children: labels.tryAgain })
|
|
3036
3529
|
] }),
|
|
3037
3530
|
withdrawal && !isLoading && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
3038
3531
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: lib.cn("flex items-center gap-3 p-4 rounded-xl", config.bg), children: [
|
|
3039
3532
|
/* @__PURE__ */ jsxRuntime.jsx(StatusIcon, { className: lib.cn("h-6 w-6", config.color, config.animate && "animate-spin") }),
|
|
3040
3533
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
|
|
3041
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-semibold", children:
|
|
3534
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-semibold", children: statusLabel }),
|
|
3042
3535
|
withdrawal.admin_notes && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground", children: withdrawal.admin_notes })
|
|
3043
3536
|
] })
|
|
3044
3537
|
] }),
|
|
3045
3538
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-muted rounded-xl p-4 space-y-3", children: [
|
|
3046
3539
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
3047
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children:
|
|
3540
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: labels.amount }),
|
|
3048
3541
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: amountUsd })
|
|
3049
3542
|
] }),
|
|
3050
3543
|
totalFeeUsd && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-sm", children: [
|
|
3051
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children:
|
|
3544
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: labels.totalFees }),
|
|
3052
3545
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-destructive", children: [
|
|
3053
3546
|
"-",
|
|
3054
3547
|
totalFeeUsd
|
|
3055
3548
|
] })
|
|
3056
3549
|
] }),
|
|
3057
3550
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between pt-2 border-t", children: [
|
|
3058
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children:
|
|
3551
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: labels.youReceive }),
|
|
3059
3552
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3060
3553
|
/* @__PURE__ */ jsxRuntime.jsx(uiCore.TokenIcon, { symbol: withdrawal.currency_code, size: 24 }),
|
|
3061
3554
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono font-bold text-lg", children: finalAmountUsd })
|
|
3062
3555
|
] })
|
|
3063
3556
|
] }),
|
|
3064
3557
|
withdrawal.crypto_amount && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-sm", children: [
|
|
3065
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children:
|
|
3558
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: labels.cryptoAmount }),
|
|
3066
3559
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-mono", children: [
|
|
3067
3560
|
withdrawal.crypto_amount,
|
|
3068
3561
|
" ",
|
|
@@ -3071,14 +3564,14 @@ function WithdrawalSheet({ withdrawalId, open, onOpenChange }) {
|
|
|
3071
3564
|
] })
|
|
3072
3565
|
] }),
|
|
3073
3566
|
withdrawal.wallet_address && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
3074
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children:
|
|
3567
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: labels.destinationWallet }),
|
|
3075
3568
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3076
3569
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 p-3 bg-muted rounded-xl font-mono text-sm break-all", children: withdrawal.wallet_address }),
|
|
3077
3570
|
/* @__PURE__ */ jsxRuntime.jsx(uiCore.CopyButton, { value: withdrawal.wallet_address, variant: "outline", className: "shrink-0" })
|
|
3078
3571
|
] })
|
|
3079
3572
|
] }),
|
|
3080
3573
|
withdrawal.transaction_hash && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
3081
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children:
|
|
3574
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: labels.transactionHash }),
|
|
3082
3575
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3083
3576
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 p-3 bg-muted rounded-xl font-mono text-sm break-all", children: withdrawal.transaction_hash }),
|
|
3084
3577
|
/* @__PURE__ */ jsxRuntime.jsx(uiCore.CopyButton, { value: withdrawal.transaction_hash, variant: "outline", className: "shrink-0" })
|
|
@@ -3092,7 +3585,7 @@ function WithdrawalSheet({ withdrawalId, open, onOpenChange }) {
|
|
|
3092
3585
|
onClick: () => window.open(withdrawal.explorer_link, "_blank"),
|
|
3093
3586
|
children: [
|
|
3094
3587
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ExternalLink, { className: "h-4 w-4 mr-2" }),
|
|
3095
|
-
|
|
3588
|
+
labels.viewOnExplorer
|
|
3096
3589
|
]
|
|
3097
3590
|
}
|
|
3098
3591
|
),
|
|
@@ -3104,29 +3597,29 @@ function WithdrawalSheet({ withdrawalId, open, onOpenChange }) {
|
|
|
3104
3597
|
onClick: handleCancel,
|
|
3105
3598
|
children: [
|
|
3106
3599
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Ban, { className: "h-4 w-4 mr-2" }),
|
|
3107
|
-
|
|
3600
|
+
labels.cancel
|
|
3108
3601
|
]
|
|
3109
3602
|
}
|
|
3110
3603
|
),
|
|
3111
3604
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2 text-xs text-muted-foreground pt-4 border-t", children: [
|
|
3112
3605
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
|
|
3113
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children:
|
|
3606
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: labels.withdrawalId }),
|
|
3114
3607
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono", children: withdrawal.id })
|
|
3115
3608
|
] }),
|
|
3116
3609
|
withdrawal.internal_withdrawal_id && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
|
|
3117
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children:
|
|
3610
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: labels.reference }),
|
|
3118
3611
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono", children: withdrawal.internal_withdrawal_id })
|
|
3119
3612
|
] }),
|
|
3120
3613
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
|
|
3121
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children:
|
|
3614
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: labels.created }),
|
|
3122
3615
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: createdAt })
|
|
3123
3616
|
] }),
|
|
3124
3617
|
completedAt && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
|
|
3125
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children:
|
|
3618
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: labels.completed }),
|
|
3126
3619
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: completedAt })
|
|
3127
3620
|
] }),
|
|
3128
3621
|
withdrawal.currency_network && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
|
|
3129
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children:
|
|
3622
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: labels.network }),
|
|
3130
3623
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: withdrawal.currency_network })
|
|
3131
3624
|
] })
|
|
3132
3625
|
] }),
|
|
@@ -3138,7 +3631,7 @@ function WithdrawalSheet({ withdrawalId, open, onOpenChange }) {
|
|
|
3138
3631
|
onClick: () => mutate(),
|
|
3139
3632
|
children: [
|
|
3140
3633
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCw, { className: "h-4 w-4 mr-2" }),
|
|
3141
|
-
|
|
3634
|
+
labels.refreshStatus
|
|
3142
3635
|
]
|
|
3143
3636
|
}
|
|
3144
3637
|
)
|
|
@@ -3150,38 +3643,69 @@ var statusConfig3 = {
|
|
|
3150
3643
|
pending: {
|
|
3151
3644
|
icon: lucideReact.Clock,
|
|
3152
3645
|
color: "text-yellow-500",
|
|
3153
|
-
bg: "bg-yellow-500/10"
|
|
3154
|
-
label: "Waiting for payment"
|
|
3646
|
+
bg: "bg-yellow-500/10"
|
|
3155
3647
|
},
|
|
3156
3648
|
confirming: {
|
|
3157
3649
|
icon: lucideReact.RefreshCw,
|
|
3158
3650
|
color: "text-blue-500",
|
|
3159
3651
|
bg: "bg-blue-500/10",
|
|
3160
|
-
label: "Confirming",
|
|
3161
3652
|
animate: true
|
|
3162
3653
|
},
|
|
3163
3654
|
completed: {
|
|
3164
3655
|
icon: lucideReact.CheckCircle2,
|
|
3165
3656
|
color: "text-green-500",
|
|
3166
|
-
bg: "bg-green-500/10"
|
|
3167
|
-
label: "Completed"
|
|
3657
|
+
bg: "bg-green-500/10"
|
|
3168
3658
|
},
|
|
3169
3659
|
failed: {
|
|
3170
3660
|
icon: lucideReact.XCircle,
|
|
3171
3661
|
color: "text-red-500",
|
|
3172
|
-
bg: "bg-red-500/10"
|
|
3173
|
-
label: "Failed"
|
|
3662
|
+
bg: "bg-red-500/10"
|
|
3174
3663
|
},
|
|
3175
3664
|
expired: {
|
|
3176
3665
|
icon: lucideReact.AlertCircle,
|
|
3177
3666
|
color: "text-muted-foreground",
|
|
3178
|
-
bg: "bg-muted"
|
|
3179
|
-
label: "Expired"
|
|
3667
|
+
bg: "bg-muted"
|
|
3180
3668
|
}
|
|
3181
3669
|
};
|
|
3182
3670
|
function PaymentSheet({ paymentId, open, onOpenChange, onCreateNew }) {
|
|
3671
|
+
const pt = usePaymentsT();
|
|
3183
3672
|
const { getPaymentDetails } = useWallet();
|
|
3184
3673
|
const [timeLeft, setTimeLeft] = react.useState("");
|
|
3674
|
+
const labels = react.useMemo(() => ({
|
|
3675
|
+
title: pt("sheets.paymentTitle"),
|
|
3676
|
+
// Status labels
|
|
3677
|
+
waiting: pt("paymentStatus.waiting"),
|
|
3678
|
+
confirming: pt("paymentStatus.confirming"),
|
|
3679
|
+
completed: pt("paymentStatus.completed"),
|
|
3680
|
+
failed: pt("paymentStatus.failed"),
|
|
3681
|
+
expired: pt("paymentStatus.expired"),
|
|
3682
|
+
paymentExpired: pt("paymentStatus.paymentExpired"),
|
|
3683
|
+
// Descriptions
|
|
3684
|
+
sendCrypto: pt("paymentDescriptions.sendCrypto"),
|
|
3685
|
+
expiredDesc: pt("paymentDescriptions.expired"),
|
|
3686
|
+
completedDesc: pt("paymentDescriptions.completed"),
|
|
3687
|
+
failedDesc: pt("paymentDescriptions.failed"),
|
|
3688
|
+
confirmingDesc: pt("paymentDescriptions.confirming"),
|
|
3689
|
+
createNew: pt("paymentDescriptions.createNew"),
|
|
3690
|
+
// Form
|
|
3691
|
+
amountToSend: pt("form.amountToSend"),
|
|
3692
|
+
equivalent: pt("form.equivalent"),
|
|
3693
|
+
network: pt("form.network"),
|
|
3694
|
+
paymentAddress: pt("form.paymentAddress"),
|
|
3695
|
+
transactionHash: pt("form.transactionHash"),
|
|
3696
|
+
paymentId: pt("form.paymentId"),
|
|
3697
|
+
orderId: pt("form.orderId"),
|
|
3698
|
+
created: pt("form.created"),
|
|
3699
|
+
// Actions
|
|
3700
|
+
tryAgain: pt("actions.tryAgain"),
|
|
3701
|
+
refreshStatus: pt("actions.refreshStatus"),
|
|
3702
|
+
createNewPayment: pt("actions.createNewPayment"),
|
|
3703
|
+
openInPaymentProvider: pt("actions.openInPaymentProvider"),
|
|
3704
|
+
// Withdraw
|
|
3705
|
+
expiresIn: pt("withdraw.expiresIn"),
|
|
3706
|
+
// Messages
|
|
3707
|
+
failedToLoadPayment: pt("messages.failedToLoadPayment")
|
|
3708
|
+
}), [pt]);
|
|
3185
3709
|
const { data: payment, isLoading, error, mutate } = useSWR__default.default(
|
|
3186
3710
|
open && paymentId ? ["payment-details", paymentId] : null,
|
|
3187
3711
|
() => getPaymentDetails(paymentId),
|
|
@@ -3222,18 +3746,25 @@ function PaymentSheet({ paymentId, open, onOpenChange, onCreateNew }) {
|
|
|
3222
3746
|
const isFailed = status === "failed";
|
|
3223
3747
|
const isConfirming = status === "confirming";
|
|
3224
3748
|
const canPay2 = isPending && !isExpired2;
|
|
3749
|
+
const statusLabels = {
|
|
3750
|
+
pending: labels.waiting,
|
|
3751
|
+
confirming: labels.confirming,
|
|
3752
|
+
completed: labels.completed,
|
|
3753
|
+
failed: labels.failed,
|
|
3754
|
+
expired: labels.expired
|
|
3755
|
+
};
|
|
3225
3756
|
let description2 = "";
|
|
3226
|
-
if (canPay2) description2 =
|
|
3227
|
-
else if (isExpired2) description2 =
|
|
3228
|
-
else if (isCompleted) description2 =
|
|
3229
|
-
else if (isFailed) description2 =
|
|
3230
|
-
else if (isConfirming) description2 =
|
|
3757
|
+
if (canPay2) description2 = labels.sendCrypto;
|
|
3758
|
+
else if (isExpired2) description2 = labels.expiredDesc;
|
|
3759
|
+
else if (isCompleted) description2 = labels.completedDesc;
|
|
3760
|
+
else if (isFailed) description2 = labels.failedDesc;
|
|
3761
|
+
else if (isConfirming) description2 = labels.confirmingDesc;
|
|
3231
3762
|
const statusBadge2 = {
|
|
3232
3763
|
bg: isExpired2 ? "bg-muted" : config2.bg,
|
|
3233
3764
|
iconColor: isExpired2 ? "text-muted-foreground" : config2.color,
|
|
3234
3765
|
iconAnimate: config2.animate,
|
|
3235
|
-
label: isExpired2 ?
|
|
3236
|
-
subtitle: canPay2 && timeLeft ?
|
|
3766
|
+
label: isExpired2 ? labels.paymentExpired : statusLabels[status],
|
|
3767
|
+
subtitle: canPay2 && timeLeft ? `${labels.expiresIn} ${timeLeft}` : isExpired2 ? labels.createNew : null
|
|
3237
3768
|
};
|
|
3238
3769
|
const qrCodeUrl2 = payment?.pay_address && canPay2 ? `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(payment.pay_address)}` : null;
|
|
3239
3770
|
const amountUsd2 = payment?.amount_usd ? `$${parseFloat(payment.amount_usd).toFixed(2)} USD` : "";
|
|
@@ -3253,12 +3784,12 @@ function PaymentSheet({ paymentId, open, onOpenChange, onCreateNew }) {
|
|
|
3253
3784
|
amountUsd: amountUsd2,
|
|
3254
3785
|
createdAt: createdAt2
|
|
3255
3786
|
};
|
|
3256
|
-
}, [payment, timeLeft]);
|
|
3787
|
+
}, [payment, timeLeft, labels]);
|
|
3257
3788
|
const { config, canPay, isExpired, description, statusBadge, qrCodeUrl, amountUsd, createdAt } = displayData;
|
|
3258
3789
|
const StatusIcon = config.icon;
|
|
3259
3790
|
return /* @__PURE__ */ jsxRuntime.jsx(uiCore.ResponsiveSheet, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(uiCore.ResponsiveSheetContent, { className: "sm:max-w-lg", children: [
|
|
3260
3791
|
/* @__PURE__ */ jsxRuntime.jsxs(uiCore.ResponsiveSheetHeader, { children: [
|
|
3261
|
-
/* @__PURE__ */ jsxRuntime.jsx(uiCore.ResponsiveSheetTitle, { children:
|
|
3792
|
+
/* @__PURE__ */ jsxRuntime.jsx(uiCore.ResponsiveSheetTitle, { children: labels.title }),
|
|
3262
3793
|
/* @__PURE__ */ jsxRuntime.jsx(uiCore.ResponsiveSheetDescription, { children: description })
|
|
3263
3794
|
] }),
|
|
3264
3795
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 sm:p-0 sm:mt-4 overflow-y-auto max-h-[70vh]", children: [
|
|
@@ -3269,8 +3800,8 @@ function PaymentSheet({ paymentId, open, onOpenChange, onCreateNew }) {
|
|
|
3269
3800
|
] }),
|
|
3270
3801
|
error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center py-12", children: [
|
|
3271
3802
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.XCircle, { className: "h-12 w-12 text-destructive mb-4" }),
|
|
3272
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mb-4", children:
|
|
3273
|
-
/* @__PURE__ */ jsxRuntime.jsx(uiCore.Button, { onClick: () => mutate(), children:
|
|
3803
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mb-4", children: labels.failedToLoadPayment }),
|
|
3804
|
+
/* @__PURE__ */ jsxRuntime.jsx(uiCore.Button, { onClick: () => mutate(), children: labels.tryAgain })
|
|
3274
3805
|
] }),
|
|
3275
3806
|
payment && !isLoading && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
3276
3807
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: lib.cn("flex items-center gap-3 p-4 rounded-xl", statusBadge.bg), children: [
|
|
@@ -3282,7 +3813,7 @@ function PaymentSheet({ paymentId, open, onOpenChange, onCreateNew }) {
|
|
|
3282
3813
|
] }),
|
|
3283
3814
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-muted rounded-xl p-4 space-y-3", children: [
|
|
3284
3815
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
3285
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children:
|
|
3816
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: labels.amountToSend }),
|
|
3286
3817
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3287
3818
|
/* @__PURE__ */ jsxRuntime.jsx(uiCore.TokenIcon, { symbol: payment.currency_code, size: 24 }),
|
|
3288
3819
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-mono font-bold text-lg", children: [
|
|
@@ -3293,17 +3824,17 @@ function PaymentSheet({ paymentId, open, onOpenChange, onCreateNew }) {
|
|
|
3293
3824
|
] })
|
|
3294
3825
|
] }),
|
|
3295
3826
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-sm", children: [
|
|
3296
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children:
|
|
3827
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: labels.equivalent }),
|
|
3297
3828
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: amountUsd })
|
|
3298
3829
|
] }),
|
|
3299
3830
|
payment.currency_network && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-sm pt-2 border-t", children: [
|
|
3300
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children:
|
|
3831
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: labels.network }),
|
|
3301
3832
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: payment.currency_network })
|
|
3302
3833
|
] })
|
|
3303
3834
|
] }),
|
|
3304
3835
|
qrCodeUrl && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center p-6 bg-white rounded-xl", children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: qrCodeUrl, alt: "Payment QR Code", className: "w-48 h-48" }) }),
|
|
3305
3836
|
payment.pay_address && canPay && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
3306
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children:
|
|
3837
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: labels.paymentAddress }),
|
|
3307
3838
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3308
3839
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 p-3 bg-muted rounded-xl font-mono text-sm break-all", children: payment.pay_address }),
|
|
3309
3840
|
/* @__PURE__ */ jsxRuntime.jsx(uiCore.CopyButton, { value: payment.pay_address, variant: "outline", className: "shrink-0" })
|
|
@@ -3318,11 +3849,11 @@ function PaymentSheet({ paymentId, open, onOpenChange, onCreateNew }) {
|
|
|
3318
3849
|
onOpenChange(false);
|
|
3319
3850
|
onCreateNew();
|
|
3320
3851
|
},
|
|
3321
|
-
children:
|
|
3852
|
+
children: labels.createNewPayment
|
|
3322
3853
|
}
|
|
3323
3854
|
),
|
|
3324
3855
|
payment.transaction_hash && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
3325
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children:
|
|
3856
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: labels.transactionHash }),
|
|
3326
3857
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-3 bg-muted rounded-xl font-mono text-sm break-all", children: payment.transaction_hash })
|
|
3327
3858
|
] }),
|
|
3328
3859
|
payment.payment_url && canPay && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3333,21 +3864,21 @@ function PaymentSheet({ paymentId, open, onOpenChange, onCreateNew }) {
|
|
|
3333
3864
|
onClick: () => window.open(payment.payment_url, "_blank"),
|
|
3334
3865
|
children: [
|
|
3335
3866
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ExternalLink, { className: "h-4 w-4 mr-2" }),
|
|
3336
|
-
|
|
3867
|
+
labels.openInPaymentProvider
|
|
3337
3868
|
]
|
|
3338
3869
|
}
|
|
3339
3870
|
),
|
|
3340
3871
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2 text-xs text-muted-foreground pt-4 border-t", children: [
|
|
3341
3872
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
|
|
3342
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children:
|
|
3873
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: labels.paymentId }),
|
|
3343
3874
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono", children: payment.id })
|
|
3344
3875
|
] }),
|
|
3345
3876
|
payment.internal_payment_id && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
|
|
3346
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children:
|
|
3877
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: labels.orderId }),
|
|
3347
3878
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono", children: payment.internal_payment_id })
|
|
3348
3879
|
] }),
|
|
3349
3880
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
|
|
3350
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children:
|
|
3881
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: labels.created }),
|
|
3351
3882
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: createdAt })
|
|
3352
3883
|
] })
|
|
3353
3884
|
] }),
|
|
@@ -3359,7 +3890,7 @@ function PaymentSheet({ paymentId, open, onOpenChange, onCreateNew }) {
|
|
|
3359
3890
|
onClick: () => mutate(),
|
|
3360
3891
|
children: [
|
|
3361
3892
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCw, { className: "h-4 w-4 mr-2" }),
|
|
3362
|
-
|
|
3893
|
+
labels.refreshStatus
|
|
3363
3894
|
]
|
|
3364
3895
|
}
|
|
3365
3896
|
)
|
|
@@ -3445,7 +3976,7 @@ function WalletPage() {
|
|
|
3445
3976
|
// package.json
|
|
3446
3977
|
var package_default = {
|
|
3447
3978
|
name: "@djangocfg/ext-payments",
|
|
3448
|
-
version: "1.0.
|
|
3979
|
+
version: "1.0.23",
|
|
3449
3980
|
description: "Payments system extension for DjangoCFG",
|
|
3450
3981
|
keywords: [
|
|
3451
3982
|
"django",
|
|
@@ -3496,6 +4027,11 @@ var package_default = {
|
|
|
3496
4027
|
types: "./dist/api/hooks.d.ts",
|
|
3497
4028
|
import: "./dist/api/hooks.js",
|
|
3498
4029
|
require: "./dist/api/hooks.cjs"
|
|
4030
|
+
},
|
|
4031
|
+
"./i18n": {
|
|
4032
|
+
types: "./dist/i18n.d.ts",
|
|
4033
|
+
import: "./dist/i18n.js",
|
|
4034
|
+
require: "./dist/i18n.cjs"
|
|
3499
4035
|
}
|
|
3500
4036
|
},
|
|
3501
4037
|
files: [
|
|
@@ -3511,27 +4047,31 @@ var package_default = {
|
|
|
3511
4047
|
peerDependencies: {
|
|
3512
4048
|
"@djangocfg/api": "workspace:*",
|
|
3513
4049
|
"@djangocfg/ext-base": "workspace:*",
|
|
4050
|
+
"@djangocfg/i18n": "workspace:*",
|
|
3514
4051
|
"@djangocfg/ui-core": "workspace:*",
|
|
3515
4052
|
"@djangocfg/ui-nextjs": "workspace:*",
|
|
4053
|
+
"@hookform/resolvers": "^5.2.2",
|
|
3516
4054
|
consola: "^3.4.2",
|
|
3517
4055
|
"lucide-react": "^0.545.0",
|
|
4056
|
+
moment: "^2.30.1",
|
|
3518
4057
|
next: "^16",
|
|
4058
|
+
"next-intl": "^4",
|
|
3519
4059
|
"p-retry": "^7.0.0",
|
|
3520
4060
|
react: "^19",
|
|
3521
|
-
swr: "^2.3.7",
|
|
3522
|
-
zod: "^4.3.4",
|
|
3523
|
-
moment: "^2.30.1",
|
|
3524
4061
|
"react-hook-form": "^7.69.0",
|
|
3525
|
-
|
|
4062
|
+
swr: "^2.3.7",
|
|
4063
|
+
zod: "^4.3.4"
|
|
3526
4064
|
},
|
|
3527
4065
|
devDependencies: {
|
|
3528
4066
|
"@djangocfg/api": "workspace:*",
|
|
3529
4067
|
"@djangocfg/ext-base": "workspace:*",
|
|
4068
|
+
"@djangocfg/i18n": "workspace:*",
|
|
3530
4069
|
"@djangocfg/typescript-config": "workspace:*",
|
|
3531
4070
|
"@djangocfg/ui-nextjs": "workspace:*",
|
|
3532
4071
|
"@types/node": "^24.7.2",
|
|
3533
4072
|
"@types/react": "^19.0.0",
|
|
3534
4073
|
consola: "^3.4.2",
|
|
4074
|
+
"next-intl": "^4.1.0",
|
|
3535
4075
|
"p-retry": "^7.0.0",
|
|
3536
4076
|
swr: "^2.3.7",
|
|
3537
4077
|
tsup: "^8.5.0",
|