import { View, Text, ScrollView } from "react-native"; import { Container } from "@/components/container"; {{#if (eq api "orpc")}} import { useQuery } from "@tanstack/react-query"; import { orpc } from "@/utils/orpc"; {{/if}} {{#if (eq api "trpc")}} import { useQuery } from "@tanstack/react-query"; import { trpc } from "@/utils/trpc"; {{/if}} {{#if (eq backend "convex")}} import { useQuery } from "convex/react"; import { api } from "@{{ projectName }}/backend/convex/_generated/api.js"; {{/if}} export default function Home() { {{#if (eq api "orpc")}} const healthCheck = useQuery(orpc.healthCheck.queryOptions()); {{/if}} {{#if (eq api "trpc")}} const healthCheck = useQuery(trpc.healthCheck.queryOptions()); {{/if}} {{#if (eq backend "convex")}} const healthCheck = useQuery(api.healthCheck.get); {{/if}} return ( BETTER T STACK API Status {{#if (eq api "orpc")}} {healthCheck.isLoading ? "Checking..." : healthCheck.data ? "Connected" : "Disconnected"} {{/if}} {{#if (eq api "trpc")}} {healthCheck.isLoading ? "Checking..." : healthCheck.data ? "Connected" : "Disconnected"} {{/if}} {{#if (eq backend "convex")}} {healthCheck === undefined ? "Checking..." : healthCheck === "OK" ? "Connected" : "Error"} {{/if}} ); }