-
-
Notifications
You must be signed in to change notification settings - Fork 197
Expand file tree
/
Copy pathPopup.tsx
More file actions
28 lines (24 loc) · 686 Bytes
/
Popup.tsx
File metadata and controls
28 lines (24 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import cls from 'classnames';
import * as React from 'react';
import type { TooltipProps } from './Tooltip';
export interface ContentProps {
prefixCls?: string;
children: (() => React.ReactNode) | React.ReactNode;
id?: string;
classNames?: TooltipProps['classNames'];
styles?: TooltipProps['styles'];
}
const Popup: React.FC<ContentProps> = (props) => {
const { children, prefixCls, id, classNames, styles } = props;
return (
<div
id={id}
className={cls(`${prefixCls}-body`, classNames?.body)}
style={styles?.body}
role="tooltip"
>
{typeof children === 'function' ? children() : children}
</div>
);
};
export default Popup;