UNPKG

@coocoon/react-awesome-query-builder

Version:

User-friendly query builder for React. Demo: https://ukrbublik.github.io/react-awesome-query-builder

14 lines (12 loc) 379 B
import React from "react"; export default ({type, label, onClick, readonly, config}) => { const typeToLabel = { "addRuleGroup": "+", "addRuleGroupExt": "+", "delGroup": "x", "delRuleGroup": "x", "delRule": "x", }; const btnLabel = label || typeToLabel[type]; return <button onClick={onClick} type="button" disabled={readonly}>{btnLabel}</button>; };