@adaptabletools/adaptable
Version:
Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
13 lines (12 loc) • 871 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { kebabCase } from '../../Utilities/Extensions/StringExtensions';
import { ADAPTABLE_BUTTON_SURFACE_DEFAULTS, AdaptableButtonView, } from '../Components/AdaptableButton';
export const CustomDashboardButton = (props) => {
const { button } = props;
const dashboardContext = {
...props.api.internalApi.buildBaseContext(),
dashboardState: props.api.dashboardApi.getDashboardState(),
};
const buttonLabel = props.api.internalApi.getLabelForButton(button, dashboardContext) ?? '';
return (_jsx(AdaptableButtonView, { button: button, context: dashboardContext, api: props.api, accessLevel: props.accessLevel, defaults: ADAPTABLE_BUTTON_SURFACE_DEFAULTS.dashboard, buttonKey: buttonLabel, ariaLabel: buttonLabel, className: `ab-DashboardToolbar__Home__${kebabCase(buttonLabel)}` }));
};