import { observer } from "mobx-react-lite";
import { QRIcon } from "../icons/qr";
import { ArrowRightIcon } from "../icons/arrow-right";
import { PopupOption, PopupOptionInfo } from "../styles";
import { ConnectorType, OmniConnector } from "../../OmniConnector";
import { OmniWallet } from "../../OmniWallet";
import { WalletType } from "../../omni/config";
import { HotConnector } from "../../HotConnector";
import { openWalletPicker } from "../router";
import { formatter } from "../../omni/utils";
import Popup from "../Popup";
import { ImageView } from "./TokenCard";
interface SelectSenderProps {
type: WalletType;
onSelect: (wallet?: OmniWallet | "qr") => void;
hot: HotConnector;
onClose: () => void;
}
export const SelectSender = observer(({ hot, type, onSelect, onClose }: SelectSenderProps) => {
const connectors = hot.connectors.filter((t) => t.walletTypes.includes(type) && t.type !== ConnectorType.SOCIAL);
const noExternal = type === WalletType.OMNI || type === WalletType.COSMOS;
const selectWallet = async (t: OmniConnector) => {
if (!t.wallets[0]) return openWalletPicker(t, (w) => (onSelect(w), onClose()));
onSelect(t.wallets[0]);
onClose();
};
return (
Send via QR code
From CEX or external wallet{t.name}
{t.wallets[0]?.address && {formatter.truncateAddress(t.wallets[0].address)}}Connect
: