@@ -3,44 +3,55 @@ import { useChatActions } from './chat.store'
33import { EuiButton , useEuiTheme } from '@elastic/eui'
44import { css } from '@emotion/react'
55import * as React from 'react'
6-
7- const buttonStyles = css `
8- border : none;
9- & > span {
10- justify-content : flex-start;
11- }
12- `
6+ import { useMemo } from 'react'
137
148export interface AskAiSuggestion {
159 question : string
1610}
1711
18- interface Props {
19- suggestions : Set < AskAiSuggestion >
20- }
12+ // Comprehensive list of AI suggestion questions
13+ const ALL_SUGGESTIONS : AskAiSuggestion [ ] = [
14+ { question : 'How do I set up a data stream in Elasticsearch?' } ,
15+ { question : 'What are the best practices for indexing performance?' } ,
16+ { question : 'How can I create a dashboard in Kibana?' } ,
17+ { question : 'What is the difference between a keyword and text field?' } ,
18+ { question : 'How do I configure machine learning jobs?' } ,
19+ { question : 'What are aggregations and how do I use them?' } ,
20+ { question : 'How do I set up Elasticsearch security and authentication?' } ,
21+ { question : 'What are the different types of Elasticsearch queries?' } ,
22+ { question : 'How do I monitor cluster health and performance?' } ,
23+ { question : 'What is the Elastic Stack and how do the components work together?' } ,
24+ { question : 'How do I create and manage Elasticsearch indices?' } ,
25+ { question : 'What are the best practices for Elasticsearch mapping?' } ,
26+ { question : 'How do I set up log shipping with Beats?' } ,
27+ { question : 'What is APM and how do I use it for application monitoring?' } ,
28+ { question : 'How do I create custom visualizations in Kibana?' } ,
29+ { question : 'What are Elasticsearch snapshots and how do I use them?' } ,
30+ { question : 'How do I configure cross-cluster search?' } ,
31+ { question : 'What are the different Elasticsearch node types and their roles?' } ,
32+ ]
2133
22- export const AskAiSuggestions = ( props : Props ) => {
34+ export const AskAiSuggestions = ( ) => {
2335 const { submitQuestion } = useChatActions ( )
2436 const { setModalMode } = useModalActions ( )
2537 const { euiTheme } = useEuiTheme ( )
2638
27- const dynamicButtonStyles = css `
28- ${ buttonStyles }
29- svg {
30- color : ${ euiTheme . colors . textSubdued } ;
31- }
32- `
33-
39+ // Randomly select 3 questions from the comprehensive list
40+ const selectedSuggestions = useMemo ( ( ) => {
41+ // Shuffle the array and take first 3
42+ const shuffled = [ ... ALL_SUGGESTIONS ] . sort ( ( ) => Math . random ( ) - 0.5 )
43+ return shuffled . slice ( 0 , 3 )
44+ } , [ ] )
45+
3446 return (
3547 < ul >
36- { Array . from ( props . suggestions ) . map ( ( suggestion ) => (
37- < li key = { suggestion . question } >
48+ { selectedSuggestions . map ( ( suggestion ) => (
49+ < li key = { suggestion . question } css = { css ` margin-bottom : ${ euiTheme . size . s } ;` } >
3850 < EuiButton
3951 iconType = "newChat"
40- color = "text "
52+ color = "primary "
4153 fullWidth
4254 size = "s"
43- css = { dynamicButtonStyles }
4455 onClick = { ( ) => {
4556 submitQuestion ( suggestion . question )
4657 setModalMode ( 'askAi' )
0 commit comments