diff --git a/components/space/Compact.tsx b/components/space/Compact.tsx index 0b1c7d9cc255..e9f1abb28e91 100644 --- a/components/space/Compact.tsx +++ b/components/space/Compact.tsx @@ -94,7 +94,9 @@ const Compact: React.FC = (props) => { () => childNodes.map((child, i) => { const key = (child && child.key) || `${prefixCls}-item-${i}`; - + if (childNodes.length === 1) { + return child; + } return ( - setShowModal(false)}> - - -
-
- -
-
- - - - -
+ {showModal && ( + setShowModal(false)}> + + +
+
+ +
+
+ + + + +
+ )} { - setShowDrawer(false)} - open={showDrawer} - > - - -
-
- - - - -
+ {showDrawer && ( + setShowDrawer(false)} + open={showDrawer} + > + + +
+
+ + + + +
+ )}