<template>
   <div class="tp-shop-widget mb-50">
      <h3 class="tp-shop-widget-title">Limpiar filtros</h3>
      <button
        @click="handleFilterReset"
        class="tp-btn"
      >
        Limpiar filtros
      </button>
    </div>
</template>

<script setup lang="ts">
import { useProductsStore } from '@/pinia/products/products.store';
import { useProductFilterStore } from '@/pinia/useProductFilterStore';
const store = useProductFilterStore();
const productsStore = useProductsStore();
const router = useRouter();
const props = defineProps<{
  filter_dropdown?: boolean;
  filter_offcanvas?: boolean;
  load_more?: boolean;
  right_side?: boolean;
  shop_full?: boolean;
  shop_1600?: boolean;
}>();

const handleFilterReset = () => {
  productsStore.resetFilters();
  const filters = productsStore.getQueryParams();
  router.push({
    path: '/search',
    query: filters,
  });
}

</script>
