import React from "react"; import InputButton from "./InputButton"; import {MdFunctions, MdInsertChart} from "react-icons/md"; import { TbMathFunction } from "react-icons/tb"; import { type WithTranslation, withTranslation } from "react-i18next"; type FunctionInputButtonsInternalProps = { fieldSpec?: any onZoomClick?(): void onDataClick?(): void onExpressionClick?(): void onElevationClick?(): void } & WithTranslation; class FunctionInputButtonsInternal extends React.Component { render() { const t = this.props.t; if (this.props.fieldSpec.expression?.parameters.includes("zoom")) { const expressionInputButton = ( ); const makeZoomInputButton = ; let makeDataInputButton; if (this.props.fieldSpec["property-type"] === "data-driven") { makeDataInputButton = ; } return
{expressionInputButton} {makeDataInputButton} {makeZoomInputButton}
; } else if (this.props.fieldSpec.expression?.parameters.includes("elevation")) { const inputElevationButton = ; return
{inputElevationButton}
; } else { return
; } } } const FunctionInputButtons = withTranslation()(FunctionInputButtonsInternal); export default FunctionInputButtons;