@brizy/ui
Version:
React elements in Brizy style
14 lines (13 loc) • 794 B
JavaScript
import { classNames } from "../classNamesFn";
import React from "react";
import { EditorIcon } from "../EditorIcon";
import { BRZ_PREFIX } from "../constants";
export const LegacyButton = ({ className, onClick, icon, children, reverse, align = "center", reverseTheme = false, title, }) => {
const _className = classNames(className)("control__button", `control__button-${align}`, {
"control__button--reverse": reverse,
"control__button--reverse-theme": reverseTheme,
});
return children || icon ? (React.createElement("div", { className: _className, onClick: onClick, title: title },
icon && React.createElement(EditorIcon, { icon: icon }),
children && React.createElement("span", { className: `${BRZ_PREFIX}-control__label` }, children))) : null;
};