@coveord/plasma-mantine
Version:
A Plasma flavoured Mantine theme
40 lines (39 loc) • 1.36 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { polymorphicFactory, useProps } from '@mantine/core';
import { Button } from '../../Button/Button.js';
import { useTableContext } from '../TableContext.js';
import { useTableActionContext } from './TableActionContext.js';
import { Menu } from '../../Menu/Menu.js';
const defaultProps = {};
export const TableActionItem = polymorphicFactory((props, ref)=>{
const { getStyles } = useTableContext();
const { primary } = useTableActionContext();
const { classNames, className, style, styles, vars: _vars, children, component, ...others } = useProps('PlasmaTableActionItem', defaultProps, props);
if (primary) {
return /*#__PURE__*/ _jsx(Button.Quaternary, {
component: component,
ref: ref,
...others,
...getStyles('actionItemRoot', {
className,
style,
classNames,
styles
}),
children: children
});
}
return /*#__PURE__*/ _jsx(Menu.Item, {
component: component,
ref: ref,
...others,
...getStyles('actionItemRoot', {
className,
style,
classNames,
styles
}),
children: children
});
});
//# sourceMappingURL=TableActionItem.js.map