@coveord/plasma-mantine
Version:
A Plasma flavoured Mantine theme
40 lines (39 loc) • 1.32 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { Menu, polymorphicFactory, useProps } from '@mantine/core';
import { Button } from '../../button';
import { useTableContext } from '../TableContext';
import { useTableActionContext } from './TableActionContext';
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, {
component: component,
ref: ref,
variant: "subtle",
...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