@adaptabletools/adaptable
Version:
Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
18 lines (17 loc) • 1.03 kB
JavaScript
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
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 (_jsxs(_Fragment, { children: [_jsx(SimpleButton, { "data-name": "share", tooltip: "Share", variant: "text", icon: "folder-shared", iconSize: buttonProps.iconSize ?? 24, onClick: () => this.setState({ open: true }), ...buttonProps }), this.state.open && (_jsx(AdaptablePopupTeamSharing, { header: Header, showPopup: true, onClose: () => this.setState({ open: false }), onConfirm: (config) => {
this.setState({ open: false });
onShare(config);
} }))] }));
}
}