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

import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import LeftMenu from 'components/LeftMenu.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import EntryDescriptor from './EntryDescriptor.vue';

import { useStateStore } from 'stores/useStateStore';
import useCardSize from 'src/composables/useCardSize';

const { t } = useI18n();
const stateStore = useStateStore();
</script>
<template>
    <template v-if="stateStore.isHeaderMounted()">
        <Teleport to="#searchbar">
            <VnSearchbar
                data-key="EntryList"
                url="Entries/filter"
                :label="t('Search entries')"
                :info="t('You can search by entry reference')"
            />
        </Teleport>
    </template>
    <QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256">
        <QScrollArea class="fit">
            <EntryDescriptor />
            <QSeparator />
            <LeftMenu source="card" />
        </QScrollArea>
    </QDrawer>
    <QPageContainer>
        <QPage>
            <VnSubToolbar />

            <div :class="useCardSize()">
                <RouterView></RouterView>
            </div>
        </QPage>
    </QPageContainer>
</template>

<i18n>
es:
    Search entries: Buscar entradas
    You can search by entry reference: Puedes buscar por referencia de la entrada
</i18n>
