sitesmith: layers panel prefers props.aiName when present
This commit is contained in:
@@ -29,7 +29,7 @@ const LayerNode: React.FC<LayerNodeProps> = ({ nodeId, depth }) => {
|
|||||||
const resolvedName = typeof nodeType === 'object' && nodeType !== null && 'resolvedName' in nodeType
|
const resolvedName = typeof nodeType === 'object' && nodeType !== null && 'resolvedName' in nodeType
|
||||||
? (nodeType as any).resolvedName
|
? (nodeType as any).resolvedName
|
||||||
: typeof nodeType === 'string' ? nodeType : undefined;
|
: typeof nodeType === 'string' ? nodeType : undefined;
|
||||||
const displayName = node.data.displayName || resolvedName || 'Component';
|
const displayName = (node.data.props?.aiName as string) || node.data.displayName || (node.data.type as any)?.resolvedName || 'Node';
|
||||||
const childNodeIds: string[] = node.data.nodes || [];
|
const childNodeIds: string[] = node.data.nodes || [];
|
||||||
const linkedNodeIds: string[] = Object.values(node.data.linkedNodes || {}) as string[];
|
const linkedNodeIds: string[] = Object.values(node.data.linkedNodes || {}) as string[];
|
||||||
const allChildren = [...childNodeIds, ...linkedNodeIds];
|
const allChildren = [...childNodeIds, ...linkedNodeIds];
|
||||||
|
|||||||
Reference in New Issue
Block a user