<script lang="ts">
    import { cartOpen, cartAmount } from '$utils/store'
    import ButtonCircle from './ButtonCircle.svelte'


    const handleCartOpening = () => {
        $cartOpen = true
    }
</script>

<div class="cart-button">
    <ButtonCircle color="purple" on:click={handleCartOpening}>
        <img src="/images/icons/pin.svg" alt="">
    </ButtonCircle>

    {#if $cartAmount > 0}
        <span class="quantity">{$cartAmount}</span>
    {/if}
</div>