infinity-forge
Version:
37 lines • 1.47 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.useColumns = useColumns;
var jsx_runtime_1 = require("react/jsx-runtime");
function useColumns(_a) {
var isOnHold = _a.isOnHold;
return [
{
id: "title",
label: "Título",
enabled: true,
Component: {
Element: function (props) { return (0, jsx_runtime_1.jsx)("span", { className: "title-td", children: props === null || props === void 0 ? void 0 : props.title }); },
},
},
{
id: "ativo",
label: "Status",
enabled: true,
Component: {
Element: function (props) { return ((0, jsx_runtime_1.jsx)(CustomOption, { active: (props === null || props === void 0 ? void 0 : props.ativo) && !isOnHold, text: ((props === null || props === void 0 ? void 0 : props.ativo) && isOnHold) ? "Em análise" : (props === null || props === void 0 ? void 0 : props.ativo) ? "Ativo" : "Inativo" })); },
},
},
];
}
function CustomOption(_a) {
var active = _a.active, text = _a.text;
var styles = {
minHeight: "18px",
padding: "0px 6px",
borderRadius: "40px",
color: active ? "#4BC097" : "#808080",
backgroundColor: active ? "#DEF1EB" : "#E6E6E6",
};
return (0, jsx_runtime_1.jsx)("span", { style: styles, children: text });
}
//# sourceMappingURL=columns.js.map