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"; {{/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 {{#if (eq backend "convex")}} Convex {healthCheck === undefined ? "Checking connection..." : healthCheck === "OK" ? "All systems operational" : "Service unavailable"} {{else}} {{#unless (eq api "none")}} {{#if (eq api "orpc")}} ORPC {{/if}} {{#if (eq api "trpc")}} TRPC {{/if}} {{#if (eq api "orpc")}} {healthCheck.isLoading ? "Checking connection..." : healthCheck.data ? "All systems operational" : "Service unavailable"} {{/if}} {{#if (eq api "trpc")}} {healthCheck.isLoading ? "Checking connection..." : healthCheck.data ? "All systems operational" : "Service unavailable"} {{/if}} {{/unless}} {{/if}} ); }