import { useAuth } from "@clerk/clerk-react";
import { clerk, connect } from "@bijectionhq/bijection/client";
import { Bijection, useClientAuth } from "@bijectionhq/bijection/react";
import type { ReactNode } from "react";
import type App from "../bijection/app";
export const auth = clerk({ template: "bijection" });
export const client = connect(import.meta.env.VITE_BIJECTION_URL, { contract: "discover", token: auth });
// Render inside <ClerkProvider>.
function SignedInView({ children }: { children: ReactNode }) {
const ready = useClientAuth(auth, useAuth());
return ready ? <Bijection client={client}>{children}</Bijection> : null;
}