\n {/* MAKE THIS TABLE RESPONSIVE */}\n {/* FIT SUPER LONG METRICS AND LABELS IN HERE */}\n
\n\n {/* Ask if you know what you want to query? */}\n {!state.askForQueryHelp && state.interactions.length === 0 && (\n <>\n
\n
\n \n \n
\n
\n >\n )}\n\n {state.interactions.map((interaction: Interaction, idx: number) => {\n return (\n
\n {interaction.suggestionType === SuggestionType.AI ? (\n <>\n
What kind of data do you want to see with your metric?
\n
\n
You do not need to enter in a metric or a label again in the prompt.
\n
Example: I want to monitor request latency, not errors.
\n
\n
\n 0}\n onChange={(e) => {\n const prompt = e.currentTarget.value;\n\n const payload = {\n idx: idx,\n interaction: { ...interaction, prompt },\n };\n\n dispatch(updateInteraction(payload));\n }}\n />\n
\n {interaction.suggestions.length === 0 ? (\n interaction.isLoading ? (\n <>\n
\n Waiting for OpenAI \n
\n >\n ) : (\n <>\n
\n
\n \n \n \n
\n
\n >\n )\n ) : (\n // LIST OF SUGGESTED QUERIES FROM AI\n
{\n const isLoading = false;\n const suggestionType = SuggestionType.AI;\n dispatch(addInteraction({ suggestionType, isLoading }));\n }}\n queryExplain={(suggIdx: number) =>\n interaction.suggestions[suggIdx].explanation === ''\n ? promQailExplain(dispatch, idx, query, interaction, suggIdx, datasource)\n : interaction.suggestions[suggIdx].explanation\n }\n onChange={onChange}\n prompt={interaction.prompt ?? ''}\n />\n )}\n >\n ) : // HISTORICAL SUGGESTIONS\n interaction.isLoading ? (\n <>\n \n Waiting for OpenAI \n
\n >\n ) : (\n // LIST OF SUGGESTED QUERIES FROM HISTORICAL DATA\n {\n const isLoading = false;\n const suggestionType = SuggestionType.AI;\n dispatch(addInteraction({ suggestionType, isLoading }));\n }}\n queryExplain={(suggIdx: number) =>\n interaction.suggestions[suggIdx].explanation === ''\n ? promQailExplain(dispatch, idx, query, interaction, suggIdx, datasource)\n : interaction.suggestions[suggIdx].explanation\n }\n onChange={onChange}\n prompt={interaction.prompt ?? ''}\n />\n )}\n