<script setup>
import { useI18n } from 'vue-i18n';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
defineProps({ dataKey: { type: String, required: true } });

const { t } = useI18n();
</script>
<template>
    <VnFilterPanel :data-key="dataKey" :search-button="true">
        <template #tags="{ tag, formatFn }">
            <div class="q-gutter-x-xs">
                <strong>{{ t(`params.${tag.label}`) }}: </strong>
                <span>{{ formatFn(tag.value) }}</span>
            </div>
        </template>
        <template #body="{ params }">
            <QItem>
                <QItemSection>
                    <VnInputNumber
                        v-model="params.daysAgo"
                        :label="t('params.daysAgo')"
                        outlined
                        rounded
                        dense
                    />
                </QItemSection>
            </QItem>
            <QItem>
                <QItemSection>
                    <VnInput
                        v-model="params.serial"
                        :label="t('params.serial')"
                        outlined
                        rounded
                        dense
                    />
                </QItemSection>
            </QItem>
        </template>
    </VnFilterPanel>
</template>
<i18n>
en:
    params:
        daysAgo: Last days
        serial: serial
es:
    params:
        daysAgo: Últimos días
        serial: serie
</i18n>
