@@ -3,44 +3,66 @@ 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+ {
24+ question :
25+ 'What is the Elastic Stack and how do the components work together?' ,
26+ } ,
27+ { question : 'How do I create and manage Elasticsearch indices?' } ,
28+ { question : 'What are the best practices for Elasticsearch mapping?' } ,
29+ { question : 'How do I set up log shipping with Beats?' } ,
30+ { question : 'What is APM and how do I use it for application monitoring?' } ,
31+ { question : 'How do I create custom visualizations in Kibana?' } ,
32+ { question : 'What are Elasticsearch snapshots and how do I use them?' } ,
33+ { question : 'How do I configure cross-cluster search?' } ,
34+ {
35+ question :
36+ 'What are the different Elasticsearch node types and their roles?' ,
37+ } ,
38+ ]
2139
22- export const AskAiSuggestions = ( props : Props ) => {
40+ export const AskAiSuggestions = ( ) => {
2341 const { submitQuestion } = useChatActions ( )
2442 const { setModalMode } = useModalActions ( )
2543 const { euiTheme } = useEuiTheme ( )
2644
27- const dynamicButtonStyles = css `
28- ${ buttonStyles }
29- svg {
30- color : ${ euiTheme . colors . textSubdued } ;
31- }
32- `
45+ // Randomly select 3 questions from the comprehensive list
46+ const selectedSuggestions = useMemo ( ( ) => {
47+ // Shuffle the array and take first 3
48+ const shuffled = [ ... ALL_SUGGESTIONS ] . sort ( ( ) => Math . random ( ) - 0.5 )
49+ return shuffled . slice ( 0 , 3 )
50+ } , [ ] )
3351
3452 return (
3553 < ul >
36- { Array . from ( props . suggestions ) . map ( ( suggestion ) => (
37- < li key = { suggestion . question } >
54+ { selectedSuggestions . map ( ( suggestion ) => (
55+ < li
56+ key = { suggestion . question }
57+ css = { css `
58+ margin-bottom : ${ euiTheme . size . s } ;
59+ ` }
60+ >
3861 < EuiButton
3962 iconType = "newChat"
40- color = "text "
63+ color = "primary "
4164 fullWidth
4265 size = "s"
43- css = { dynamicButtonStyles }
4466 onClick = { ( ) => {
4567 submitQuestion ( suggestion . question )
4668 setModalMode ( 'askAi' )
0 commit comments