import React from 'react'; import { TransactionSection, FieldRow } from './CommonFields'; import { CryptoCreateAccountData, CryptoUpdateAccountData, CryptoDeleteData, CryptoApproveAllowanceData, CryptoDeleteAllowanceData, } from './types'; export const CryptoCreateAccountSection: React.FC<{ cryptoCreateAccount: CryptoCreateAccountData; }> = ({ cryptoCreateAccount }) => (
); export const CryptoUpdateAccountSection: React.FC<{ cryptoUpdateAccount: CryptoUpdateAccountData; }> = ({ cryptoUpdateAccount }) => (
); export const CryptoDeleteSection: React.FC<{ cryptoDelete: CryptoDeleteData; }> = ({ cryptoDelete }) => (
); export const CryptoApproveAllowanceSection: React.FC<{ cryptoApproveAllowance: CryptoApproveAllowanceData; }> = ({ cryptoApproveAllowance }) => (
{cryptoApproveAllowance.hbarAllowances && cryptoApproveAllowance.hbarAllowances.length > 0 && (
HBAR Allowances ({cryptoApproveAllowance.hbarAllowances.length})
{cryptoApproveAllowance.hbarAllowances.map((allowance, idx) => (
Owner: {allowance.ownerAccountId} → Spender:{' '} {allowance.spenderAccountId} | Amount: {allowance.amount} ℏ
))}
)} {cryptoApproveAllowance.tokenAllowances && cryptoApproveAllowance.tokenAllowances.length > 0 && (
Token Allowances ({cryptoApproveAllowance.tokenAllowances.length})
{cryptoApproveAllowance.tokenAllowances.map((allowance, idx) => (
Token: {allowance.tokenId} | Owner: {allowance.ownerAccountId}{' '} → Spender: {allowance.spenderAccountId} | Amount:{' '} {allowance.amount}
))}
)} {cryptoApproveAllowance.nftAllowances && cryptoApproveAllowance.nftAllowances.length > 0 && (
NFT Allowances ({cryptoApproveAllowance.nftAllowances.length})
{cryptoApproveAllowance.nftAllowances.map((allowance, idx) => (
Token: {allowance.tokenId} | Owner: {allowance.ownerAccountId}{' '} → Spender: {allowance.spenderAccountId} {allowance.approvedForAll && ( ALL )} {allowance.serialNumbers && allowance.serialNumbers.length > 0 && ( Serials: {allowance.serialNumbers.join(', ')} )}
))}
)}
); export const CryptoDeleteAllowanceSection: React.FC<{ cryptoDeleteAllowance: CryptoDeleteAllowanceData; }> = ({ cryptoDeleteAllowance }) => (
{cryptoDeleteAllowance.nftAllowancesToRemove && cryptoDeleteAllowance.nftAllowancesToRemove.length > 0 && (
NFT Allowances to Remove ( {cryptoDeleteAllowance.nftAllowancesToRemove.length})
{cryptoDeleteAllowance.nftAllowancesToRemove.map( (allowance, idx) => (
Token: {allowance.tokenId} | Owner:{' '} {allowance.ownerAccountId} {allowance.serialNumbers && allowance.serialNumbers.length > 0 && ( Serials: {allowance.serialNumbers.join(', ')} )}
) )}
)}
);