feat: wire convex data foundations
This commit is contained in:
16
components/convex-client-provider.tsx
Normal file
16
components/convex-client-provider.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
"use client";
|
||||
|
||||
import { ConvexProvider, ConvexReactClient } from "convex/react";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
const convexUrl = process.env.NEXT_PUBLIC_CONVEX_URL;
|
||||
|
||||
if (!convexUrl) {
|
||||
throw new Error("Missing NEXT_PUBLIC_CONVEX_URL in the environment.");
|
||||
}
|
||||
|
||||
const convex = new ConvexReactClient(convexUrl);
|
||||
|
||||
export function ConvexClientProvider({ children }: { children: ReactNode }) {
|
||||
return <ConvexProvider client={convex}>{children}</ConvexProvider>;
|
||||
}
|
||||
Reference in New Issue
Block a user