@tomino/dynamic-form-semantic-ui
Version:
Semantic UI form renderer based on dynamic form generation
17 lines • 697 B
JavaScript
import React from 'react';
import { Icon } from 'semantic-ui-react';
import { css } from '../../common';
import { EditorContext } from '../editor_context';
const image = css `
width: 16px;
height: 16px;
vertical-align: middle;
margin-right: 6px;
`;
export const ToolIcon = ({ icon, thumbnail, title }) => {
const context = React.useContext(EditorContext);
return (React.createElement(React.Fragment, null,
icon && React.createElement(Icon, { name: icon, title: title }),
thumbnail && (React.createElement("img", { src: context.theme.dark ? thumbnail.dark : thumbnail.light, alt: "icon", className: image, title: title }))));
};
//# sourceMappingURL=tool_icon.js.map