import * as React from 'react';
import SimpleButton from '../../../components/SimpleButton';
import { AdaptablePopupTeamSharing } from '../Popups/AdaptablePopupTeamSharing';
export class ButtonShare extends React.Component {
    constructor(props) {
        super(props);
        this.state = { open: false };
    }
    render() {
        const { onShare, Header, ...buttonProps } = this.props;
        return (React.createElement(React.Fragment, null,
            React.createElement(SimpleButton, { "data-name": "share", tooltip: "Share", variant: "text", icon: "folder-shared", iconSize: buttonProps.iconSize ?? 24, onClick: () => this.setState({ open: true }), ...buttonProps }),
            this.state.open && (React.createElement(AdaptablePopupTeamSharing, { header: Header, showPopup: true, onClose: () => this.setState({ open: false }), onConfirm: (config) => {
                    this.setState({ open: false });
                    onShare(config);
                } }))));
    }
}
