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; const FunctionInputButtonsInternal: React.FC = (props) => { const t = props.t; if (props.fieldSpec.expression?.parameters.includes("zoom")) { const expressionInputButton = ( ); const makeZoomInputButton = ; let makeDataInputButton; if (props.fieldSpec["property-type"] === "data-driven") { makeDataInputButton = ; } return
{expressionInputButton} {makeDataInputButton} {makeZoomInputButton}
; } else if (props.fieldSpec.expression?.parameters.includes("elevation")) { const inputElevationButton = ; return
{inputElevationButton}
; } else { return
; } }; export const FunctionInputButtons = withTranslation()(FunctionInputButtonsInternal);