import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useBridgeWizardStore } from '../bridgeWizardStore.js';
import { chainIdByParentChainName } from '../../../../queries/chains.js';
import { chainById } from '../../../../util/chains/chains.js';
import { zodSupportedNetwork } from '../../../../util/fetchSuperchainRegistryChainList.js';
import { Select } from '@inkjs/ui';
import { Box, Text } from 'ink';
export const SelectNetwork = () => {
    const { wizardState, submitSelectNetwork } = useBridgeWizardStore();
    if (wizardState.stepId !== 'select-network') {
        throw new Error('Invalid state');
    }
    return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, children: "Select which Superchain network the chain is based on?" }), _jsx(Select, { options: zodSupportedNetwork.options.map(network => ({
                    label: `${network} (${chainById[chainIdByParentChainName[network]]?.name})`,
                    value: network,
                })), onChange: value => submitSelectNetwork({ network: value }) })] }));
};
