<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 w-[107px] h-[24px] py-3 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>
