<script setup>

const userData = useCookie('userData').value
const router = useRouter()

const props = defineProps({
    vaga: Object
})

const vaga = ref(props.vaga)

watch(() => props.vaga, (newVaga) => {
    vaga.value = newVaga
})

/*const emit = defineEmits([

])*/
</script>

<template>
    <VCard class="vaga-card cursor-pointer">
        <VCardText>
            <div class="container__vaga-empresa-data" @click="detalhesVaga(vaga.slug)">
                <div>
                  <img v-if="vaga.logo" v-bind:src="vaga.logo" alt="Logo da Empresa" />
                  <p v-else>{{ vaga.empresa }}</p>
                </div>
                <div class="mb-3">
                  <VChip color="primary" label style="font-size: 14px; width: fit-content !important;" v-if="vaga.distance">
                    {{ vaga.distance.replace(' ', '') }} de você
                  </VChip>
                  <p v-else class="mb-0">
                    <VIcon icon="tabler-clock" size="14" style="margin-top: -2px;" /> {{ formatDate(vaga.createdAt) }}
                  </p>
                </div>
              </div>
        </VCardText>
    </VCard>
</template>