UNPKG

@react-awesome-query-builder/antd

Version:
26 lines (22 loc) 701 B
import React from "react"; import { PlusOutlined, PlusCircleOutlined, DeleteFilled, HolderOutlined } from "@ant-design/icons"; import { Utils } from "@react-awesome-query-builder/ui"; const { DragIcon } = Utils; const typeToIcon = { "addRule": <PlusOutlined />, "addGroup": <PlusCircleOutlined />, "delRule": <DeleteFilled />, "delGroup": <DeleteFilled />, "delRuleGroup": <DeleteFilled />, "addSubRuleSimple": <PlusOutlined />, "addSubRule": <PlusOutlined />, "addSubGroup": <PlusCircleOutlined />, "drag": <HolderOutlined />, }; export default ({type}) => { let icon = typeToIcon[type] || null; if (!icon && type === "drag") { icon = <DragIcon />; } return icon; };