import type { FunctionComponent } from "react"; import React from "react"; import { SolidProfileShapeShapeType } from "./ldo/solidProfile.shapeTypes"; import BlurTextInput from "./BlurTextInput"; import { useSolidAuth, useLdo, useDataResource, useSubject, } from "@ldobjects/solid-react"; const Profile: FunctionComponent = () => { const { changeData, commitData } = useLdo(); const { session } = useSolidAuth(); const webId = session.webId!; const webIdResource = useDataResource(webId); const [profile, profileError] = useSubject(SolidProfileShapeShapeType, webId); if (webIdResource.isLoading) { return

Loading

; } else if (profileError) { return

profileError.message

; } else { return (
{ const cProfile = changeData(profile, webIdResource); cProfile.name = text; await commitData(cProfile); }} />
); } }; export default Profile;