import * as React from 'react';
import SimpleButton from '../../components/SimpleButton';
import { useAdaptable } from '../AdaptableContext';
import { isPivotLayout } from '../../Utilities/isPivotLayout';
export const LayoutCloneButton = ({ data, accessLevel }) => {
    const adaptable = useAdaptable();
    const isDisabled = accessLevel === 'ReadOnly';
    const handleClick = React.useCallback(() => {
        adaptable.api.layoutApi.showLayoutEditor(data.Name, isPivotLayout(data) ? 'pivot' : 'table', 'Clone');
    }, []);
    return (React.createElement(SimpleButton, { onClick: handleClick, disabled: isDisabled, variant: "text", icon: "clone", tooltip: "Clone" }));
};
