import React, { useRef } from "react"; import PropTypes from "prop-types"; import { isFunction, get, findIndex } from "lodash"; import Dropdown from "antd/lib/dropdown"; import Menu from "antd/lib/menu"; import Typography from "antd/lib/typography"; import { DynamicDateType } from "@/services/parameters/DateParameter"; import { DynamicDateRangeType } from "@/services/parameters/DateRangeParameter"; import ArrowLeftOutlinedIcon from "@ant-design/icons/ArrowLeftOutlined"; import ThunderboltTwoToneIcon from "@ant-design/icons/ThunderboltTwoTone"; import ThunderboltOutlinedIcon from "@ant-design/icons/ThunderboltOutlined"; import "./DynamicButton.less"; const { Text } = Typography; function DynamicButton({ options, selectedDynamicValue, onSelect, enabled, staticValueLabel }) { const menu = (
); const containerRef = useRef(null); return ( ); } DynamicButton.propTypes = { options: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types selectedDynamicValue: PropTypes.oneOfType([DynamicDateType, DynamicDateRangeType]), onSelect: PropTypes.func, enabled: PropTypes.bool, staticValueLabel: PropTypes.string, }; DynamicButton.defaultProps = { options: [], selectedDynamicValue: null, onSelect: () => {}, enabled: false, staticValueLabel: "Back to Static Value", }; export default DynamicButton;