@adaptabletools/adaptable
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
14 lines (13 loc) • 613 B
JavaScript
import * as React from 'react';
import { isAdaptableSystemIcon } from '../../../components/Icon';
import SimpleButton from '../../../components/SimpleButton';
import { useAdaptable } from '../../AdaptableContext';
// This component is connected to adaptable and know about custom icons
export const AdaptableButtonComponent = (props) => {
let icon = props.icon;
const adaptable = useAdaptable();
if (isAdaptableSystemIcon(icon)) {
icon = adaptable.api.userInterfaceApi.internalApi.prepareAdaptableIconDef(icon);
}
return React.createElement(SimpleButton, { ...props, icon: icon });
};