(props: { locationId: string })
| 87 | } |
| 88 | |
| 89 | function Location(props: { locationId: string }) { |
| 90 | const query = useQuery(() => locationsQueries.detail(props.locationId)) |
| 91 | |
| 92 | return ( |
| 93 | <Switch> |
| 94 | <Match when={query.status === 'pending'}> |
| 95 | <span>Loading...</span> |
| 96 | </Match> |
| 97 | <Match when={query.status === 'error'}> |
| 98 | <span>Error :(</span> |
| 99 | </Match> |
| 100 | <Match when={query.data}> |
| 101 | {(data) => ( |
| 102 | <span> |
| 103 | {data().name} - {data().type} |
| 104 | </span> |
| 105 | )} |
| 106 | </Match> |
| 107 | </Switch> |
| 108 | ) |
| 109 | } |
| 110 | |
| 111 | export default Character |
nothing calls this directly
no test coverage detected