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")}} {{#if (eq auth "clerk")}} import { Link } from "expo-router"; import { Authenticated, AuthLoading, Unauthenticated, useQuery } from "convex/react"; import { api } from "@{{ projectName }}/backend/convex/_generated/api"; import { useUser } from "@clerk/clerk-expo"; import { SignOutButton } from "@/components/sign-out-button"; {{else}} import { useQuery } from "convex/react"; import { api } from "@{{ projectName }}/backend/convex/_generated/api"; {{/if}} {{/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")}} {{#if (eq auth "clerk")}} const { user } = useUser(); const healthCheck = useQuery(api.healthCheck.get); const privateData = useQuery(api.privateData.get); {{else}} const healthCheck = useQuery(api.healthCheck.get); {{/if}} {{/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}} {{#if (and (eq backend "convex") (eq auth "clerk"))}} Hello {user?.emailAddresses[0].emailAddress} Private Data: {privateData?.message} Sign in Sign up Loading... {{/if}} ); }