1
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
"use client";
|
||||
|
||||
import React, { forwardRef } from 'react';
|
||||
import { clsx } from 'clsx';
|
||||
export const InternalPanel = /*#__PURE__*/forwardRef((props, ref) => {
|
||||
const {
|
||||
prefixCls,
|
||||
className,
|
||||
children,
|
||||
size,
|
||||
style = {}
|
||||
} = props;
|
||||
const panelClassName = clsx(`${prefixCls}-panel`, {
|
||||
[`${prefixCls}-panel-hidden`]: size === 0
|
||||
}, className);
|
||||
const hasSize = size !== undefined;
|
||||
return /*#__PURE__*/React.createElement("div", {
|
||||
ref: ref,
|
||||
className: panelClassName,
|
||||
style: {
|
||||
...style,
|
||||
// Use auto when start from ssr
|
||||
flexBasis: hasSize ? size : 'auto',
|
||||
flexGrow: hasSize ? 0 : 1
|
||||
}
|
||||
}, children);
|
||||
});
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
InternalPanel.displayName = 'Panel';
|
||||
}
|
||||
const Panel = () => null;
|
||||
export default Panel;
|
||||
Reference in New Issue
Block a user