import { SolidProfileShapeType } from '../../../.ldo/profile.shapeTypes'; import { useResource, useSolidAuth, useSubject } from '@ldo/solid-react'; import React, { FunctionComponent, ReactNode } from 'react'; import { View } from 'react-native'; import { ProfileAvatar } from '../../common/ProfileAvatar'; import { Text } from '../../ui/text'; interface AgentInformationProps { webId: string; accessoryRight?: ReactNode; } export const AgentInformation: FunctionComponent = ({ webId, accessoryRight, }) => { const { session } = useSolidAuth(); useResource(webId); const agentProfile = useSubject(SolidProfileShapeType, webId); return ( {agentProfile['@id'] === session.webId ? 'You' : (agentProfile.fn ?? agentProfile.name ?? 'Unnamed Agent')} {webId} ); };