MCPcopy
hub / github.com/tinyplex/tinybase / RelationshipsView

Function RelationshipsView

src/ui-solid-inspector/index.tsx:982–1011  ·  view source on GitHub ↗
(
  props: {readonly relationshipsId?: Id} & StoreProp,
)

Source from the content-addressed store, hash-verified

980};
981
982const RelationshipsView = (
983 props: {readonly relationshipsId?: Id} & StoreProp,
984) => {
985 const relationships = useRelationships(props.relationshipsId);
986 const relationshipIds = useRelationshipIds(relationships);
987 return (
988 <>
989 {isUndefined(relationships()) ? (
990 EMPTY_STRING
991 ) : (
992 <Details
993 uniqueId={getUniqueId('r', props.relationshipsId)}
994 title={'Relationships: ' + (props.relationshipsId ?? DEFAULT)}
995 s={props.s}
996 >
997 {arrayIsEmpty(relationshipIds())
998 ? 'No relationships defined'
999 : sortedIdsMap(relationshipIds(), (relationshipId) => (
1000 <RelationshipView
1001 relationships={relationships()}
1002 relationshipsId={props.relationshipsId}
1003 relationshipId={relationshipId}
1004 s={props.s}
1005 />
1006 ))}
1007 </Details>
1008 )}
1009 </>
1010 );
1011};
1012
1013const Header = (props: StoreProp) => {
1014 const position = useValue(POSITION_VALUE, props.s);

Callers

nothing calls this directly

Calls 7

useRelationshipsFunction · 0.90
useRelationshipIdsFunction · 0.90
isUndefinedFunction · 0.90
getUniqueIdFunction · 0.90
arrayIsEmptyFunction · 0.90
sortedIdsMapFunction · 0.90
relationshipsFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…