<script setup>
import { useI18n } from 'vue-i18n';
import { useStateStore } from 'stores/useStateStore';
import { useRoute } from 'vue-router';
import CustomerDescriptor from './CustomerDescriptor.vue';
import LeftMenu from 'components/LeftMenu.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';

const stateStore = useStateStore();
const route = useRoute();
const { t } = useI18n();
</script>
<template>
    <Teleport to="#searchbar" v-if="stateStore.isHeaderMounted()">
        <VnSearchbar
            data-key="CustomerList"
            url="Clients/filter"
            :label="t('Search customer')"
            :info="t('You can search by customer id or name')"
        />
    </Teleport>
    <QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256">
        <QScrollArea class="fit">
            <CustomerDescriptor />
            <QSeparator />
            <LeftMenu source="card" />
        </QScrollArea>
    </QDrawer>
    <QPageContainer>
        <QPage>
            <VnSubToolbar />
            <div class="q-pa-md"><RouterView></RouterView></div>
        </QPage>
    </QPageContainer>
</template>

<i18n>
es:
    Search customer: Buscar cliente
    You can search by customer id or name: Puedes buscar por id o nombre del cliente
</i18n>
