import { IconButton, IconButtonProps, useTheme } from "@mui/material";
import { ForwardRefExoticComponent, RefAttributes } from "react";
import { LinkProps } from "react-router-dom";
import { deepmerge } from "@mui/utils";


type Props = IconButtonProps & {
    component?: ForwardRefExoticComponent<LinkProps & RefAttributes<HTMLAnchorElement>>;
    to?: string;
};

export function WalletButton(props: Props) {
    const theme = useTheme();

    return (
        <IconButton
            {...deepmerge({
                sx: {
                    height: 36,
                    width: 36,
                    p: 0,
                    borderRadius: "6px",
                    backgroundColor: theme.palette.background.default,
                    color: theme.palette.gray.main,
                    "&:hover": {
                        color: theme.palette.background.default,
                        backgroundColor: theme.palette.gray.main,
                    },
                    "&:active": {
                        backgroundColor: theme.palette.purple.dark,
                        color: "white",
                    },
                },
            }, props)}
        >
            <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 36 37" fill="none">
                <path d="M26.571 16.051v-5c0-.789-.64-1.428-1.428-1.428H9.429c-.79 0-1.429.64-1.429 1.428v14.286c0 .789.64 1.428 1.429 1.428h15.714c.789 0 1.428-.64 1.428-1.428v-5m1.33-5h-7.044a2.857 2.857 0 0 0 0 5.714h7.044a.099.099 0 0 0 .099-.099v-5.516a.1.1 0 0 0-.099-.1Z" stroke="currentColor" strokeWidth="1.5" />
            </svg>
        </IconButton>
    );
}
