UNPKG

@talend/react-components

Version:
42 lines 1.15 kB
import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import I18N_DOMAIN_COMPONENTS from '../../../constants'; import Action from '../../../Actions/Action'; import badgeCssModule from '../../Badge.module.scss'; import { getTheme } from '../../../theme'; import { jsx as _jsx } from "react/jsx-runtime"; const theme = getTheme(badgeCssModule); function BadgeDelete({ disabled, id, label, onClick, dataFeature }) { const { t } = useTranslation(I18N_DOMAIN_COMPONENTS); return /*#__PURE__*/_jsx(Action, { className: theme('tc-badge-delete-icon'), disabled: disabled, hideLabel: true, icon: "talend-cross", id: id && `tc-badge-delete-${id}`, label: label || t('BADGE_DELETE', { defaultValue: 'Delete' }), link: true, onClick: onClick, role: "button", "data-feature": dataFeature }, "delete"); } BadgeDelete.propTypes = { disabled: PropTypes.bool, id: PropTypes.string, label: PropTypes.string, onClick: PropTypes.func.isRequired, dataFeature: PropTypes.string }; export default BadgeDelete; //# sourceMappingURL=BadgeDelete.component.js.map