import { Modal } from "antd";
import { EthereumLogo } from "assets/Ethereum-logo";

function ModalCheckout({ nftToBuy, onCancel, onOk }) {
  return (
    <Modal visible={true} onCancel={onCancel} onOk={onOk} width={600}>
      <div
        style={{
          display: "flex",
          alignItems: "center",
          flexDirection: "column",
        }}
      >
        <div
          style={{
            textAlign: "center",
            fontWeight: 600,
            borderBottom: "1px solid black",
            paddingBottom: 8,
            marginBottom: 16,
            width: "100%",
          }}
        >
          Complete Checkout
        </div>

        <div
          style={{
            width: "100%",
            padding: 16,
          }}
        >
          <div
            style={{
              display: "flex",
              justifyContent: "space-between",
              padding: 6,
              fontWeight: 600,
              borderBottom: "1px solid black",
            }}
          >
            <div>Item</div>
            <div>Subtotal</div>
          </div>

          <div
            style={{
              display: "flex",
              justifyContent: "space-between",

              padding: 6,
              borderBottom: "1px solid black",
            }}
          >
            <div>
              <img
                style={{
                  maxHeight: 110,
                }}
                src={nftToBuy.image}
                alt=""
              />
            </div>
            <div>
              <div style={{ color: "blue" }}>Artist name</div>
              <div
                style={{ fontSize: 16, fontWeight: 600 }}
              >{`${nftToBuy.name} ${nftToBuy.token_id}`}</div>
              <div style={{ fontSize: 12 }}>Creator Fees: 5%</div>
            </div>
            <div>
              <div
                style={{
                  display: "flex",
                  alignItems: "center",
                }}
              >
                <EthereumLogo style={{ transform: "scale(0.75)" }} />
                {nftToBuy.currentPrice}
              </div>
              <div>price in usd</div>
            </div>
          </div>
          <div
            style={{
              display: "flex",
              justifyContent: "space-between",
              alignItems: "center",
              width: "100%",
              padding: 6,
              marginTop: 6,
            }}
          >
            <div>Total</div>
            <div>
              <div
                style={{
                  color: "blue",
                  fontSize: 16,
                  display: "flex",
                  alignItems: "center",
                }}
              >
                <EthereumLogo style={{ transform: "scale(0.75)" }} />
                {nftToBuy.currentPrice}
              </div>
              <div>price in usd</div>
            </div>
          </div>
        </div>
      </div>
    </Modal>
  );
}

export default ModalCheckout;
