@parkassist/pa-ui-library
Version:
INX Platform elements
62 lines • 1.82 kB
JavaScript
var __rest = this && this.__rest || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React from "react";
import { Row, Column } from "../Layout/Flex";
import { Button } from "../../index";
const ButtonWithIcon = _a => {
var {
text,
icon = null,
iconRight = null,
action,
disabled = false,
width,
big = false,
small = false,
dark = false,
dangerous = false,
outline = false,
transparent = false
} = _a,
props = __rest(_a, ["text", "icon", "iconRight", "action", "disabled", "width", "big", "small", "dark", "dangerous", "outline", "transparent"]);
return _jsx(Button, Object.assign({}, props, {
dark: dark,
dangerous: dangerous,
disabled: disabled,
onClick: action,
width: width,
big: big,
small: small,
outline: outline,
transparent: transparent,
children: _jsxs(Row, {
style: {
justifyContent: "space-evenly",
alignItems: "center"
},
children: [icon && _jsx(Column, {
style: {
justifyContent: "center",
marginRight: 5
},
children: icon
}), _jsx(Column, {
children: text
}), iconRight && _jsx(Column, {
style: {
justifyContent: "center",
marginLeft: 5
},
children: iconRight
})]
})
}));
};
export default ButtonWithIcon;