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

import VnCard from 'components/common/VnCard.vue';
import TicketDescriptor from './TicketDescriptor.vue';
import TicketFilter from '../TicketFilter.vue';

const { t } = useI18n();
const route = useRoute();

const routeName = computed(() => route.name);
const searchBarDataKeys = {
    TicketSummary: 'TicketSummary',
    TicketSale: 'TicketSale',
    TicketPurchaseRequest: 'TicketPurchaseRequest',
};
</script>
<template>
    <VnCard
        data-key="Ticket"
        :filter-panel="TicketFilter"
        :descriptor="TicketDescriptor"
        :search-data-key="searchBarDataKeys[routeName]"
        :search-custom-route-redirect="routeName"
        :searchbar-label="t('card.search')"
        :searchbar-info="t('card.searchInfo')"
    />
</template>
