<template>
  <nuxt-link to="/" class="flex items-center cursor-pointer gap-sm mr-7" v-if="website">
    <el-image v-if="website.websiteLogo || logo?.value" :style="`${logo?.style}`" :src="logo?.value || website?.websiteLogo" class="rounded-sm rounded-sm sm:h-[74px] sm:w-[320px] h-[40px] py-1 sm:py-0"/>
    <h4 v-else class="text-gray-700 text-xl font-bold" :style="`${logo?.style}`">{{ website?.websiteName }}</h4>
  </nuxt-link>
</template>

<script setup lang="ts">
import {useLogo, useWebsite} from "~/composables/configState";
import {listCmsWebsiteField} from "~/api/cms/cmsWebsiteField";
const logo = useLogo()
const website = useWebsite();

listCmsWebsiteField({
  name: 'siteLogo'
}).then(data => {
  if(data[0]){
    logo.value = data[0]
  }
})
</script>

<style scoped lang="scss">
</style>
