UNPKG

@wordpress/components

Version:
43 lines (34 loc) 760 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _element = require("@wordpress/element"); /** * Internal dependencies */ function Shortcut(props) { const { shortcut, className } = props; if (!shortcut) { return null; } let displayText; let ariaLabel; if (typeof shortcut === 'string') { displayText = shortcut; } if (shortcut !== null && typeof shortcut === 'object') { displayText = shortcut.display; ariaLabel = shortcut.ariaLabel; } return (0, _element.createElement)("span", { className: className, "aria-label": ariaLabel }, displayText); } var _default = Shortcut; exports.default = _default; //# sourceMappingURL=index.js.map