import type { RenderExpandIconProps, Key, GetRowKey } from '../interface'; export function renderExpandIcon({ prefixCls, record, onExpand, expanded, expandable, }: RenderExpandIconProps) { const expandClassName = `${prefixCls}-row-expand-icon`; if (!expandable) { return ; } const onClick = event => { onExpand(record, event); event.stopPropagation(); }; return ( ); } export function findAllChildrenKeys( data: readonly RecordType[], getRowKey: GetRowKey, childrenColumnName: string, ): Key[] { const keys: Key[] = []; function dig(list: readonly RecordType[]) { (list || []).forEach((item, index) => { keys.push(getRowKey(item, index)); dig((item as any)[childrenColumnName]); }); } dig(data); return keys; }