import * as React from 'react';
import SimpleButton from '../../components/SimpleButton';
import { useAdaptable } from '../AdaptableContext';
import { isPivotLayout } from '../../Utilities/isPivotLayout';
export const EditCurrentLayoutButton = () => {
    const adaptable = useAdaptable();
    const handleClick = React.useCallback(() => {
        const currentLayout = adaptable.api.layoutApi.getCurrentLayout();
        const layoutName = currentLayout.Name;
        const type = isPivotLayout(currentLayout) ? 'pivot' : 'table';
        adaptable.api.layoutApi.showLayoutEditor(layoutName, type, 'Edit');
    }, []);
    return (React.createElement(SimpleButton, { className: "twa:ml-1", variant: "text", iconSize: 15, icon: "edit", onClick: handleClick }));
};
