2021-02-25 18:37:07 +00:00
|
|
|
<template>
|
|
|
|
<header>
|
2024-04-01 15:18:22 +00:00
|
|
|
<img v-if="showLogo" :src="logoURL" />
|
|
|
|
<Action
|
|
|
|
v-if="showMenu"
|
2021-03-21 11:51:58 +00:00
|
|
|
class="menu-button"
|
|
|
|
icon="menu"
|
2024-04-01 15:18:22 +00:00
|
|
|
:label="t('buttons.toggleSidebar')"
|
|
|
|
@action="layoutStore.showHover('sidebar')"
|
2021-03-21 11:51:58 +00:00
|
|
|
/>
|
2021-02-25 18:37:07 +00:00
|
|
|
|
|
|
|
<slot />
|
|
|
|
|
2024-04-01 15:18:22 +00:00
|
|
|
<div
|
|
|
|
id="dropdown"
|
|
|
|
:class="{ active: layoutStore.currentPromptName === 'more' }"
|
|
|
|
>
|
2021-02-25 18:37:07 +00:00
|
|
|
<slot name="actions" />
|
|
|
|
</div>
|
|
|
|
|
2024-04-01 15:18:22 +00:00
|
|
|
<Action
|
|
|
|
v-if="ifActionsSlot"
|
2021-03-21 11:51:58 +00:00
|
|
|
id="more"
|
|
|
|
icon="more_vert"
|
2024-04-01 15:18:22 +00:00
|
|
|
:label="t('buttons.more')"
|
|
|
|
@action="layoutStore.showHover('more')"
|
2021-03-21 11:51:58 +00:00
|
|
|
/>
|
|
|
|
|
|
|
|
<div
|
|
|
|
class="overlay"
|
2024-04-01 15:18:22 +00:00
|
|
|
v-show="layoutStore.currentPromptName == 'more'"
|
|
|
|
@click="layoutStore.closeHovers"
|
2021-03-21 11:51:58 +00:00
|
|
|
/>
|
2021-02-25 18:37:07 +00:00
|
|
|
</header>
|
|
|
|
</template>
|
|
|
|
|
2024-04-01 15:18:22 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
import { useLayoutStore } from "@/stores/layout";
|
|
|
|
|
2021-03-21 11:51:58 +00:00
|
|
|
import { logoURL } from "@/utils/constants";
|
2021-02-25 18:37:07 +00:00
|
|
|
|
2023-08-26 11:55:51 +00:00
|
|
|
import Action from "@/components/header/Action.vue";
|
2024-04-01 15:18:22 +00:00
|
|
|
import { computed, useSlots } from "vue";
|
|
|
|
import { useI18n } from "vue-i18n";
|
|
|
|
|
|
|
|
defineProps<{
|
|
|
|
showLogo?: boolean;
|
|
|
|
showMenu?: boolean;
|
|
|
|
}>();
|
|
|
|
|
|
|
|
const layoutStore = useLayoutStore();
|
|
|
|
const slots = useSlots();
|
|
|
|
|
|
|
|
const { t } = useI18n();
|
|
|
|
|
|
|
|
const ifActionsSlot = computed(() => (slots.actions ? true : false));
|
2021-02-25 18:37:07 +00:00
|
|
|
</script>
|
|
|
|
|
2021-03-21 11:51:58 +00:00
|
|
|
<style></style>
|