// import getCookie from "../get_cookie.js"
import { Controller } from "../stimulus.js"

export default class extends Controller {
    static values = { url: String }

    connect() {
        this.event = new CustomEvent('addToCart', {
            detail: {
                item: this.urlValue
            }
        })
    }

    start() {
        
    }

    addToCart(event) {
        event.preventDefault()
        window.dispatchEvent(this.event)
    }
}