import { View, Text, Button, ScrollView, Spinner, Card, XStack } from "tamagui"; import React from "react"; import useThemeStore from "@/stores/theme"; import { useQuery } from "@tanstack/react-query"; import api from "@/lib/api"; import { Stack } from "expo-router"; import Pressable from "@/components/ui/pressable"; import Icons from "@/components/ui/icons"; export default function Hosts() { const { toggle } = useThemeStore(); const hosts = useQuery({ queryKey: ["hosts"], queryFn: () => api("/hosts"), }); return ( <> ( ), }} /> {hosts.isLoading ? ( Loading... ) : ( {hosts.data.rows?.map((host: any) => ( {host.label} {host.host} ))} )} ); }