UNPKG

@wordpress/components

Version:
29 lines (25 loc) 698 B
import _extends from "@babel/runtime/helpers/esm/extends"; import { createElement } from "@wordpress/element"; /** * @typedef OwnProps * * @property {string} icon Icon name * @property {string} [className] Class name */ /** @typedef {import('react').ComponentPropsWithoutRef<'span'> & OwnProps} Props */ /** * @param {Props} props * @return {JSX.Element} Element */ function Dashicon({ icon, className, ...extraProps }) { const iconClass = ['dashicon', 'dashicons', 'dashicons-' + icon, className].filter(Boolean).join(' '); return createElement("span", _extends({ className: iconClass }, extraProps)); } export default Dashicon; //# sourceMappingURL=index.js.map