2019-03-27 09:36:14 +01:00
|
|
|
/**
|
|
|
|
* React component for a popup content container
|
|
|
|
*
|
|
|
|
* Takes in a prop for rendering the content inside the popup
|
|
|
|
*/
|
|
|
|
import * as React from "react";
|
|
|
|
|
|
|
|
type ReactComponent = new(...args: any[]) => React.Component<any, any>
|
|
|
|
|
|
|
|
interface IProps {
|
|
|
|
content: ReactComponent;
|
|
|
|
id: string;
|
2021-05-01 09:17:31 +02:00
|
|
|
props: any;
|
2019-03-27 09:36:14 +01:00
|
|
|
}
|
|
|
|
|
2019-05-15 05:56:59 +02:00
|
|
|
export function Popup(props: IProps): React.ReactElement {
|
|
|
|
return (
|
|
|
|
<div className={"popup-box-content"} id={`${props.id}-content`}>
|
|
|
|
{React.createElement(props.content, props.props)}
|
|
|
|
</div>
|
|
|
|
)
|
2019-03-27 09:36:14 +01:00
|
|
|
}
|