1- import React , { useState } from 'react' ;
1+ import React , { useState , useEffect } from 'react' ;
22import Layout from '@theme/Layout' ;
33import { Box , Button , Container , Grid , Stack , Tab , Tabs , Typography } from '@mui/material' ;
44import { TabContext , TabPanel } from '@mui/lab' ;
@@ -7,45 +7,94 @@ import heroImage from '../../static/img/hero-secondary-graphic.webp';
77import SumoLogicDocsLogo from '../../static/img/sumo-logic-docs.svg' ;
88import { Feature } from '../components/Feature' ;
99import { features } from '../helper/features' ;
10- import ErrorBoundary from '../components/ErrorBoundary' ; // Import the ErrorBoundary component
10+ import ErrorBoundary from '../components/ErrorBoundary' ;
11+ import Berry from '../components/Berry' ;
1112
1213export const Home = ( ) => {
1314 const [ tab , setTab ] = useState ( '0' ) ;
1415
16+ const questions = [
17+ '✨ timestamps' ,
18+ '✨ how do you write a log search query?' ,
19+ '✨ how do I set up alerts?' ,
20+ '✨ what types of logs can I analyze?' ,
21+ '✨ what is copilot?' ,
22+ '✨ cloud siem' ,
23+ '✨ how do I change my password?' ,
24+ '✨ what is the parse operator?'
25+ ] ;
26+
27+ const handleQuestionClick = ( question ) => {
28+ if ( window . Berry ) {
29+ if ( window . Berry . sendMessage ) {
30+ window . Berry . sendMessage ( question ) ;
31+ }
32+ }
33+ } ;
34+
1535 return (
1636 < ErrorBoundary >
1737 < Layout
1838 description = 'Sumo Logic docs - real-time alerting, security, dashboards, and machine-learning-powered analytics for all three types of telemetry — logs, metrics, and traces.'
1939 title = 'Home'
2040 >
21- { /* Header */ }
22- < Typography
23- bgcolor = '#0045BE'
24- color = '#e3e3e3'
25- fontFamily = 'Lab Grotesque'
26- fontSize = { 28 }
27- fontWeight = { 700 }
28- pt = { 3 }
29- px = { 2 }
30- pb = { 1 }
31- sx = { {
32- backgroundImage : 'linear-gradient(to right, rgb(0,0,153), rgb(0,70,190) 30%)' ,
33- } }
34- textAlign = 'center'
35- >
36- < Box
37- component = { SumoLogicDocsLogo }
38- alt = "Sumo Logic Docs logo"
39- role = "<img>"
40- aria-hidden = "true"
41- height = { {
42- md : 36 ,
43- xs : 28 ,
44- } }
45- width = '100%'
46- />
47- </ Typography >
4841
42+ < Berry mode = 'inline' />
43+
44+ { /* Suggested Questions */ }
45+ < Box sx = { { width : '100%' , background : '#2a2a2a' , color : '#fff' , py : 4 } } >
46+
47+ < Container maxWidth = "md" sx = { { textAlign : 'center' } } >
48+ < Typography variant = "h4" fontWeight = { 600 } mt = { 1 } mb = { 3 } >
49+ Sumo Logic Documentation
50+ </ Typography >
51+ < Typography variant = "h5" fontFamily = "Lab Grotesque" fontWeight = { 300 } mb = { 2 } sx = { { background : 'linear-gradient(90deg, #9900ED, #C04CF4, #00C8E0)' , WebkitBackgroundClip : 'text' , WebkitTextFillColor : 'transparent' } } >
52+ Our Docs Assistant is here to help!
53+ </ Typography >
54+ < Typography fontFamily = "Lab Grotesque" fontSize = { 13 } fontWeight = { 300 } mb = { 2 } >
55+ Ask me anything! You can type full questions, sentences, or just keywords, and I'll help you find the information you need. Try these to get started:
56+ </ Typography >
57+ < Stack
58+ direction = "row"
59+ spacing = { 1 } // Reduced horizontal spacing between buttons
60+ justifyContent = "center"
61+ flexWrap = "wrap"
62+ rowGap = { 1 } // Reduced vertical spacing between rows
63+ >
64+
65+ { questions . map ( ( question , index ) => (
66+ < Button
67+ key = { index }
68+ onClick = { ( ) => handleQuestionClick ( question ) }
69+ variant = "outlined"
70+ sx = { {
71+ bgcolor : 'transparent' ,
72+ color : '#DDDDDD' ,
73+ fontFamily : 'Lab Grotesque' ,
74+ borderColor : '#808080' ,
75+ borderRadius : '5px' ,
76+ textTransform : 'lowercase' ,
77+ fontSize : '12px' ,
78+ fontWeight : '300' ,
79+ padding : '4px 6px' ,
80+ minWidth : 'auto' ,
81+ '&:hover' : {
82+ bgcolor : '#2a2a2a' ,
83+ color : '#DDDDDD' ,
84+ } ,
85+ } }
86+ >
87+ { question }
88+ </ Button >
89+ ) ) }
90+ </ Stack >
91+
92+ { /* Inline Chatbot Container */ }
93+ < Box id = "inline-berry-chatbot-container" sx = { { my : 4 , p : 2 , margin : '0 auto' , textAlign : 'center' } } >
94+ { /* The chatbot will render here */ }
95+ </ Box >
96+ </ Container >
97+ </ Box >
4998 { /* Hero */ }
5099 < Stack
51100 sx = { {
0 commit comments