<script setup>
const props = defineProps({
  row: {
    type: Object,
    required: true,
    default: {}
  }
})

const supabase = useSupabaseClient()


let vehicles = await Promise.all(props.row.vehicles.map(async (i) => {
  return (await supabase.from("vehicles").select("id,licensePlate").eq("id",i).single()).data.licensePlate
}))

</script>

<template>
  <div v-if="props.row.vehicles">
    {{props.row.vehicles ? vehicles.join(", ") : ''}}
  </div>
</template>
