<template>
  <!-- Cart Summary Button -->
  <div v-if="marketStore.totalCartItems > 0" class="fixed bottom-4 right-4 z-50">
    <Button @click="viewCart" class="shadow-lg">
      <ShoppingCart class="w-5 h-5 mr-2" />
      Cart ({{ marketStore.totalCartItems }})
    </Button>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import { useMarketStore } from '@/modules/market/stores/market'
import { Button } from '@/components/ui/button'
import { ShoppingCart } from 'lucide-vue-next'

const router = useRouter()
const marketStore = useMarketStore()

const viewCart = () => {
  router.push('/cart')
}
</script>