@coveord/plasma-mantine
Version:
A Plasma flavoured Mantine theme
30 lines (29 loc) • 1.06 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { IconTrash } from '@coveord/plasma-react-icons';
import { Box } from '@mantine/core';
import { ActionIcon } from '../../../ActionIcon/ActionIcon.js';
import { useCollectionContext } from '../../CollectionContext.js';
/**
* Shared remove button component used by both horizontal and vertical layouts.
* Renders a trash icon button when removable, or a spacer div otherwise.
*/ export const RemoveButton = ({ removable, onRemove })=>{
const { getStyles } = useCollectionContext();
if (!removable || !onRemove) {
return /*#__PURE__*/ _jsx("div", {
style: {
width: 28
}
});
}
return /*#__PURE__*/ _jsx(Box, {
...getStyles('removeButton'),
children: /*#__PURE__*/ _jsx(ActionIcon.Quaternary, {
onClick: onRemove,
children: /*#__PURE__*/ _jsx(IconTrash, {
"aria-label": "Remove",
size: 16
})
})
});
};
//# sourceMappingURL=RemoveButton.js.map