import { formatEther } from 'viem';
export const bridgeWizardStepMetadatas = [
    {
        step: 'select-network',
        title: 'Select network',
        getSummary: (state) => `${state.network}`,
    },
    {
        step: 'enter-private-key',
        title: 'Connect account',
        getSummary: (state) => `${state.address}`,
    },
    {
        step: 'select-chains',
        title: 'Select chains',
        getSummary: (state) => `${state.chainIds.map(chainId => `${chainId}`).join(', ')}`,
    },
    {
        step: 'enter-amount',
        title: 'Enter amount',
        getSummary: (state) => {
            const perChainAmount = Number(formatEther(state.amount)).toFixed(2);
            const totalAmount = Number(formatEther(state.amount * BigInt(state.chainIds.length))).toFixed(2);
            return `${perChainAmount} ETH × ${state.chainIds.length} chains = ${totalAmount} ETH total`;
        },
    },
    {
        step: 'confirm-transaction',
        title: 'Confirm transaction',
        getSummary: () => '',
    },
];
export const bridgeWizardStepMetadataByStep = bridgeWizardStepMetadatas.reduce((acc, metadata) => {
    acc[metadata.step] = metadata;
    return acc;
}, {});
export const indexByBridgeWizardStep = bridgeWizardStepMetadatas.reduce((acc, metadata, index) => {
    acc[metadata.step] = index;
    return acc;
}, {});
export const isAfterStep = (currentStep, targetStep) => {
    return (indexByBridgeWizardStep[currentStep] > indexByBridgeWizardStep[targetStep]);
};
