<template>
  <div class="vtj-logo" @click="onClick">
    <img
      v-if="props.icon"
      :title="props.text"
      class="vtj-logo__icon"
      :src="props.icon" />
    <span v-else>{{ props.text }}</span>
  </div>
</template>

<script lang="ts" setup>
interface Props {
  icon?: string;
  text?: string;
  link?: string;
}

const props = withDefaults(defineProps<Props>(), {
  text: 'Tj'
});

const onClick = () => {
  if (props.link) {
    location.href = props.link;
  }
};

defineExpose({
  props
});
</script>
