Open History to see the last commit
1<script setup lang="ts">
2import { useQuery } from '@tanstack/vue-query'
3import { planetsQueries } from './services/planets/queries'
4β
5const props = defineProps<{ homeworldId: string }>()
6β
7const { data, status } = useQuery(() =>
8 planetsQueries.detail(props.homeworldId),
9)
10</script>
11β
12<template>
13 <span v-if="status === 'pending'">Loading...</span>
14 <span v-else-if="status === 'error'">Error :(</span>
15 <span v-else-if="data">{{ data.name }}</span>
16</template>