import React, { useState } from "react"; import { signIn, auth } from "./pocketbase"; export default function Root({ children }) { const [userAuth, setUserAuth] = useState(""); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [loading, setLoading] = useState(false); const handleSubmit = async (event) => { event.preventDefault(); setLoading(true) await signIn(email,password) setLoading(false) }; auth.onChange(async function (user) { if (user !== null) { setUserAuth(user); } }); return ( <> {userAuth != "" ? ( <>{children}> ) : (