<script setup>
import { computed } from 'vue';
import { useRoute } from 'vue-router';

import VnCard from 'components/common/VnCard.vue';
import CustomerDescriptor from './CustomerDescriptor.vue';
import CustomerFilter from '../CustomerFilter.vue';
const route = useRoute();

const routeName = computed(() => route.name);
</script>
<template>
    <VnCard
        data-key="Client"
        base-url="Clients"
        :descriptor="CustomerDescriptor"
        :filter-panel="routeName != 'CustomerConsumption' && CustomerFilter"
        search-data-key="CustomerList"
        :searchbar-props="{
            url: 'Clients/filter',
            label: 'Search customer',
            info: 'You can search by customer id or name',
        }"
    />
</template>
