@react-awesome-query-builder-dev/ui
Version:
User-friendly query builder for React. Core React UI
16 lines (13 loc) • 379 B
JSX
import React from "react";
const typeToLabel = {
"addSubRuleSimple": "+",
"addSubRule": "+",
"addSubGroup": "+",
"delGroup": "x",
"delRuleGroup": "x",
"delRule": "x",
};
export default ({type, label, onClick, readonly}) => {
const btnLabel = label || typeToLabel[type];
return <button onClick={onClick} type="button" disabled={readonly}>{btnLabel}</button>;
};