import React, {useState} from "react";
import style from "./basket.module.sass";
import ModalBasket from "../../modals/modalBasketGoods/modalBasketGoods";

const Basket = (props) => {
    const [showModal, setStatusModal] = useState(false);

    return(
        <>
            <ModalBasket
                isOpen={showModal}
                onRequestClose={() => setStatusModal(false)}
            />
            <p onClick={() => {
                if(localStorage.getItem("goodsData")
                    && JSON.parse(localStorage.getItem("goodsData")).length >= 1) {

                    setStatusModal(true);
                }
            }}>Корзина</p>
        </>
    );
};

export default Basket;