import React from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faCircle } from "@fortawesome/free-solid-svg-icons"; import guidGenerator from "../utilities/randomId"; /** * This function splits the input of a dashboard field into the parts that are inside and outside of ${...} * @param {*} text - the value of the input in the Dashboard Input Field * @returns */ const findReferences = (text) => { var splitText = text.split('${'); let textArray = [splitText[0]]; for (var i = 1; i < splitText.length; i++) { let insideBrackets = "${" + splitText[i].split('}')[0] if (splitText[i].includes('}')) { insideBrackets += "}" } textArray.push(insideBrackets) textArray.push(splitText[i].split('}')[1]) } return textArray; } /** * This component renders the input fields on the dashboard * @param {*} index - the order number of a keyPair * @param {*} onChangeHandler - what happens when the input is modified * @param {*} type - whether the input field is for a Key Name or for a Key Value * @param {*} value - value of the InputField * @param {*} blurred - whether the input field should be blurred (behind the gray dots) or not; this can be turned on/off in the dashboard * @returns */ const DashboardInputField = ({index, onChangeHandler, type, value, blurred}) => { if (type === "varName") { return (