| 1 |
<script lang="ts" setup> |
| 2 |
import Button from "@/components/Button/Button.vue"; |
| 3 |
import { useGeneralStoreData } from "@/stores"; |
| 4 |
import { EditSiteButton, HeaderButton, PreviewSiteButton } from "@/types"; |
| 5 |
|
| 6 |
const props = defineProps<Props>(); |
| 7 |
|
| 8 |
const { siteUrl, editSiteUrl } = useGeneralStoreData(); |
| 9 |
|
| 10 |
type Props = { |
| 11 |
title?: string; |
| 12 |
headerButton?: HeaderButton; |
| 13 |
previewSiteButton?: PreviewSiteButton; |
| 14 |
editSiteButton?: EditSiteButton; |
| 15 |
}; |
| 16 |
</script> |
| 17 |
|
| 18 |
<template> |
| 19 |
<div class="wrapper"> |
| 20 |
<div class="wrapper__content"> |
| 21 |
<div class="wrapper__header"> |
| 22 |
<h1 |
| 23 |
v-if="props.title" |
| 24 |
class="text-heading-1" |
| 25 |
> |
| 26 |
{{ props.title }} |
| 27 |
</h1> |
| 28 |
<div class="wrapper__buttons-wrapper"> |
| 29 |
<Button |
| 30 |
v-if="headerButton" |
| 31 |
class="wrapper__button" |
| 32 |
:to="headerButton?.href" |
| 33 |
size="small" |
| 34 |
variant="outline" |
| 35 |
:target="headerButton.href ? '_blank' : undefined" |
| 36 |
icon-append="icon-launch" |
| 37 |
@click="headerButton?.onClick" |
| 38 |
> |
| 39 |
{{ headerButton.text }} |
| 40 |
</Button> |
| 41 |
<Button |
| 42 |
v-if="previewSiteButton && siteUrl" |
| 43 |
class="wrapper__button" |
| 44 |
:to="siteUrl" |
| 45 |
size="small" |
| 46 |
variant="outline" |
| 47 |
:target="siteUrl ? '_blank' : undefined" |
| 48 |
icon-prepend="icon-visibility" |
| 49 |
@click="previewSiteButton?.onClick" |
| 50 |
> |
| 51 |
{{ previewSiteButton.text }} |
| 52 |
</Button> |
| 53 |
<Button |
| 54 |
v-if="editSiteButton && editSiteUrl" |
| 55 |
class="wrapper__button" |
| 56 |
:to="editSiteUrl" |
| 57 |
size="small" |
| 58 |
variant="outline" |
| 59 |
:target="editSiteUrl ? '_blank' : undefined" |
| 60 |
icon-prepend="icon-launch" |
| 61 |
@click="editSiteButton?.onClick" |
| 62 |
> |
| 63 |
{{ editSiteButton.text }} |
| 64 |
</Button> |
| 65 |
</div> |
| 66 |
</div> |
| 67 |
<slot /> |
| 68 |
</div> |
| 69 |
</div> |
| 70 |
</template> |
| 71 |
|
| 72 |
<style lang="scss" scoped> |
| 73 |
.wrapper { |
| 74 |
padding: 48px; |
| 75 |
display: flex; |
| 76 |
flex-direction: column; |
| 77 |
align-items: center; |
| 78 |
justify-content: center; |
| 79 |
text-align: left; |
| 80 |
min-height: calc(100vh - var(--header-height)); |
| 81 |
|
| 82 |
@media (max-width: 768px) { |
| 83 |
padding-right: 10px; |
| 84 |
padding-left: 0px; |
| 85 |
} |
| 86 |
|
| 87 |
&__buttons-wrapper { |
| 88 |
display: flex; |
| 89 |
|
| 90 |
@media (max-width: 500px) { |
| 91 |
width: 100%; |
| 92 |
flex-wrap: wrap; |
| 93 |
} |
| 94 |
} |
| 95 |
|
| 96 |
&__header { |
| 97 |
display: flex; |
| 98 |
justify-content: space-between; |
| 99 |
align-items: center; |
| 100 |
flex-wrap: wrap; |
| 101 |
} |
| 102 |
|
| 103 |
&__button { |
| 104 |
background-color: var(--white); |
| 105 |
margin-left: 10px; |
| 106 |
display: flex; |
| 107 |
flex-wrap: nowrap; |
| 108 |
|
| 109 |
@media (max-width: 500px) { |
| 110 |
margin: 5px 0; |
| 111 |
} |
| 112 |
} |
| 113 |
|
| 114 |
&__content { |
| 115 |
max-width: 740px; |
| 116 |
width: 100%; |
| 117 |
} |
| 118 |
} |
| 119 |
</style> |
| 120 |
|