@wordpress/components
Version:
UI components for WordPress.
35 lines (28 loc) • 617 B
JavaScript
import { createElement } from "@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 createElement("span", {
className: className,
"aria-label": ariaLabel
}, displayText);
}
export default Shortcut;
//# sourceMappingURL=index.js.map