import { useState } from "react"; import type { FunctionComponent } from "react"; import React from "react"; import { useResource, useSolidAuth, useSubject } from "@ldo/solid-react"; import { SolidProfileShapeShapeType } from "./.ldo/solidProfile.shapeTypes"; import { Link } from "react-router-dom"; const DEFAULT_ISSUER = "https://solidweb.me"; export const LoggedInHeader: FunctionComponent<{ webId: string }> = ({ webId, }) => { const webIdResource = useResource(webId); const profile = useSubject(SolidProfileShapeShapeType, webId); const { logout } = useSolidAuth(); return ( <> Logged in as {webId}. Welcome{" "} {webIdResource.isReading() ? "LOADING NAME" : profile.fn} ); }; export const Header: FunctionComponent = () => { const [issuer, setIssuer] = useState(DEFAULT_ISSUER); const { login, signUp, session } = useSolidAuth(); return (
{session.isLoggedIn ? ( ) : ( <> setIssuer(e.target.value)} /> )}

Blog {" "} Profile

); };