mirror of
https://github.com/linsa-io/linsa.git
synced 2026-07-12 23:12:39 +02:00
chore: provider jazz
This commit is contained in:
@@ -1,15 +1,23 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import { createJazzReactContext } from "jazz-react"
|
import { createJazzReactContext, DemoAuth } from "jazz-react"
|
||||||
import { DemoAuth } from "@/components/custom/demo-auth"
|
import { AuthUI } from "@/components/custom/auth-ui"
|
||||||
import { LaAccount } from "../schema"
|
import { LaAccount } from "@/lib/schema"
|
||||||
|
|
||||||
const Jazz = createJazzReactContext({
|
const appName = process.env.NEXT_PUBLIC_APP_NAME!
|
||||||
auth: DemoAuth({ appName: "Learn Anything", accountSchema: LaAccount }),
|
|
||||||
peer: "wss://mesh.jazz.tools/?key=iupin5212@gmail.com" // <- put your email here to get a proper API key later
|
const auth = DemoAuth<LaAccount>({
|
||||||
|
appName,
|
||||||
|
Component: AuthUI,
|
||||||
|
accountSchema: LaAccount
|
||||||
})
|
})
|
||||||
|
|
||||||
export const { useAccount, useCoState } = Jazz
|
const Jazz = createJazzReactContext({
|
||||||
|
auth,
|
||||||
|
peer: "wss://mesh.jazz.tools/?key=example@gmail.com"
|
||||||
|
})
|
||||||
|
|
||||||
|
export const { useAccount, useCoState, useAcceptInvite } = Jazz
|
||||||
|
|
||||||
export function JazzProvider({ children }: { children: React.ReactNode }) {
|
export function JazzProvider({ children }: { children: React.ReactNode }) {
|
||||||
return <Jazz.Provider>{children}</Jazz.Provider>
|
return <Jazz.Provider>{children}</Jazz.Provider>
|
||||||
|
|||||||
Reference in New Issue
Block a user