import { Avatar, Button, Col, Menu, Row } from "antd"; import { ContentImage } from "../Components/Image"; import { Link } from "react-router-dom"; import { LogOut } from "../Components/Icons/LogOut"; import { NLView } from "../types"; import { UserReadPrivateResponse } from "@newstackdev/iosdk-newgraph-client-js"; import { useActions, useAppState } from "../overmind"; import { useCachedUser } from "../hooks/useCached"; export const AuthWidget: NLView = () => { const state = useAppState(); const actions = useActions(); const isAuthorized = state.api.auth.authorized; const user: UserReadPrivateResponse | null = state.api.auth.user; const u = useCachedUser({ id: user?.id }, true); const profileLink = () => state.auth.authenticated ? ( !state.api.auth.authorized ? ( ) : ( } className="avatar-image-header" /> Profile ) ) : (
); return ( <> {profileLink()} {profileLink()} {isAuthorized && ( )} ); };