"use client" {{#if (eq backend "convex")}} import { useQuery } from "convex/react"; import { api } from "@{{projectName}}/backend/convex/_generated/api"; {{else if (or (eq api "orpc") (eq api "trpc"))}} import { useQuery } from "@tanstack/react-query"; {{#if (eq api "orpc")}} import { orpc } from "@/utils/orpc"; {{/if}} {{#if (eq api "trpc")}} import { trpc } from "@/utils/trpc"; {{/if}} {{/if}} const TITLE_TEXT = ` ██████╗ ███████╗████████╗████████╗███████╗██████╗ ██╔══██╗██╔════╝╚══██╔══╝╚══██╔══╝██╔════╝██╔══██╗ ██████╔╝█████╗ ██║ ██║ █████╗ ██████╔╝ ██╔══██╗██╔══╝ ██║ ██║ ██╔══╝ ██╔══██╗ ██████╔╝███████╗ ██║ ██║ ███████╗██║ ██║ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ████████╗ ███████╗████████╗ █████╗ ██████╗██╗ ██╗ ╚══██╔══╝ ██╔════╝╚══██╔══╝██╔══██╗██╔════╝██║ ██╔╝ ██║ ███████╗ ██║ ███████║██║ █████╔╝ ██║ ╚════██║ ██║ ██╔══██║██║ ██╔═██╗ ██║ ███████║ ██║ ██║ ██║╚██████╗██║ ██╗ ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ `; export default function Home() { {{#if (eq backend "convex")}} const healthCheck = useQuery(api.healthCheck.get); {{else if (eq api "orpc")}} const healthCheck = useQuery(orpc.healthCheck.queryOptions()); {{else if (eq api "trpc")}} const healthCheck = useQuery(trpc.healthCheck.queryOptions()); {{/if}} return (
{TITLE_TEXT}

API Status

{{#if (eq backend "convex")}}
{healthCheck === undefined ? "Checking..." : healthCheck === "OK" ? "Connected" : "Error"}
{{else}} {{#unless (eq api "none")}}
{healthCheck.isLoading ? "Checking..." : healthCheck.data ? "Connected" : "Disconnected"}
{{/unless}} {{/if}}
); }