11import { Box , Button , Modal , Text , Tooltip , px } from '@mantine/core' ;
2- import { FC , useEffect } from 'react' ;
2+ import { FC , useEffect , useMemo } from 'react' ;
33import { useInfoModalStyles } from './styles' ;
44import { useGetAbout } from '@/hooks/useGetAbout' ;
55import { IconAlertCircle , IconBook2 , IconBrandGithub , IconBrandSlack , IconBusinessplan } from '@tabler/icons-react' ;
@@ -69,6 +69,14 @@ const InfoModal: FC<InfoModalProps> = (props) => {
6969 } ;
7070 } , [ ] ) ;
7171
72+ const llmStatus = useMemo ( ( ) => {
73+ let status = 'LLM API Key not set' ;
74+ if ( data ?. llmActive ) {
75+ status = `${ data . llmProvider } configured` ;
76+ }
77+ return status ;
78+ } , [ data ?. llmActive ] ) ;
79+
7280 const { classes } = useInfoModalStyles ( ) ;
7381 const {
7482 container,
@@ -80,96 +88,91 @@ const InfoModal: FC<InfoModalProps> = (props) => {
8088 aboutTextKey,
8189 aboutTextValue,
8290 aboutTextInnerBox,
83- actionBtnRed
91+ actionBtnRed,
8492 } = classes ;
8593
8694 return (
87- < Modal
88- opened = { opened }
89- onClose = { close }
90- withinPortal
91- withCloseButton = { false }
92- size = "xl"
93- centered >
95+ < Modal opened = { opened } onClose = { close } withinPortal withCloseButton = { false } size = "xl" centered >
9496 < Box className = { container } >
95-
96- < Text className = { aboutTitle } > About Parseable</ Text >
97- < Text className = { aboutDescription } id = "info-modal-description" > Important info about your Parseable deployment</ Text >
98- { error ? (
99- < Text className = { aboutDescription } > Error...</ Text >
100- ) : loading ? (
101- < Text className = { aboutDescription } > Loading...</ Text >
102- ) : data ? (
103- < >
104- < Box className = { aboutTextBox } >
105- < Box className = { aboutTextInnerBox } >
106- < Text className = { aboutTextKey } > License: </ Text >
107- < Text className = { aboutTextValue } > { data . license } </ Text >
108- < Button
97+ < Text className = { aboutTitle } > About Parseable</ Text >
98+ < Text className = { aboutDescription } id = "info-modal-description" >
99+ Important info about your Parseable deployment
100+ </ Text >
101+ { error ? (
102+ < Text className = { aboutDescription } > Error...</ Text >
103+ ) : loading ? (
104+ < Text className = { aboutDescription } > Loading...</ Text >
105+ ) : data ? (
106+ < >
107+ < Box className = { aboutTextBox } >
108+ < Box className = { aboutTextInnerBox } >
109+ < Text className = { aboutTextKey } > License: </ Text >
110+ < Text className = { aboutTextValue } > { data . license } </ Text >
111+ < Button
109112 variant = "outline"
110113 component = { 'a' }
111114 href = "mailto:[email protected] ?subject=Production%20Support%20Query" 112115 target = "_blank"
113- className = { actionBtn }
114- >
116+ className = { actionBtn } >
115117 Upgrade to production support
116118 </ Button >
117- </ Box >
118119 </ Box >
119- < Box className = { aboutTextBox } >
120- < Box className = { aboutTextInnerBox } >
121- < Text className = { aboutTextKey } > Commit: </ Text >
122- < Text className = { aboutTextValue } > { data . commit } </ Text >
123- </ Box >
124- < Box className = { aboutTextInnerBox } >
125- < Text className = { aboutTextKey } > Version: </ Text >
126- < Text className = { aboutTextValue } > { data . version } </ Text >
127- { data . updateAvailable ? (
128- < Button
120+ </ Box >
121+ < Box className = { aboutTextBox } >
122+ < Box className = { aboutTextInnerBox } >
123+ < Text className = { aboutTextKey } > Commit: </ Text >
124+ < Text className = { aboutTextValue } > { data . commit } </ Text >
125+ </ Box >
126+ < Box className = { aboutTextInnerBox } >
127+ < Text className = { aboutTextKey } > Version: </ Text >
128+ < Text className = { aboutTextValue } > { data . version } </ Text >
129+ { data . updateAvailable ? (
130+ < Button
129131 variant = "outline"
130132 component = { 'a' }
131133 href = "https://github.com/parseablehq/parseable/releases/latest"
132134 target = "_blank"
133135 className = { actionBtnRed }
134- leftIcon = { < IconAlertCircle size = { px ( '1.2rem' ) } stroke = { 1.5 } /> }
135- >
136+ leftIcon = { < IconAlertCircle size = { px ( '1.2rem' ) } stroke = { 1.5 } /> } >
136137 Upgrade to latest version { data . latestVersion }
137- </ Button > ) : null }
138- </ Box >
139-
138+ </ Button >
139+ ) : null }
140140 </ Box >
141- < Box className = { aboutTextBox } >
142- < Box className = { aboutTextInnerBox } >
143- < Text className = { aboutTextKey } > Deployment Id: </ Text >
144- < Text className = { aboutTextValue } > { data . deploymentId } </ Text >
145- </ Box >
146- < Box className = { aboutTextInnerBox } >
147- < Text className = { aboutTextKey } > Mode</ Text >
148- < Text className = { aboutTextValue } > { data . mode } </ Text >
149- </ Box >
150- < Box className = { aboutTextInnerBox } >
151- < Text className = { aboutTextKey } > Staging</ Text >
152- < Text className = { aboutTextValue } > { data . staging } </ Text >
153- </ Box >
154- < Box className = { aboutTextInnerBox } >
155- < Text className = { aboutTextKey } > Store</ Text >
156- < Text className = { aboutTextValue } > { data . store } </ Text >
157- </ Box >
141+ </ Box >
142+ < Box className = { aboutTextBox } >
143+ < Box className = { aboutTextInnerBox } >
144+ < Text className = { aboutTextKey } > Deployment Id: </ Text >
145+ < Text className = { aboutTextValue } > { data . deploymentId } </ Text >
158146 </ Box >
159- </ >
160- ) : null }
161-
162- < Text className = { aboutTitle } > Need help?</ Text >
163- < Text className = { aboutDescription } > Ensure uninterrupted deployment</ Text >
147+ < Box className = { aboutTextInnerBox } >
148+ < Text className = { aboutTextKey } > Mode</ Text >
149+ < Text className = { aboutTextValue } > { data . mode } </ Text >
150+ </ Box >
151+ < Box className = { aboutTextInnerBox } >
152+ < Text className = { aboutTextKey } > Staging</ Text >
153+ < Text className = { aboutTextValue } > { data . staging } </ Text >
154+ </ Box >
155+ < Box className = { aboutTextInnerBox } >
156+ < Text className = { aboutTextKey } > Store</ Text >
157+ < Text className = { aboutTextValue } > { data . store } </ Text >
158+ </ Box >
159+ < Box className = { aboutTextInnerBox } >
160+ < Text className = { aboutTextKey } > LLM Status</ Text >
161+ < Text className = { aboutTextValue } > { llmStatus } </ Text >
162+ </ Box >
163+ </ Box >
164+ </ >
165+ ) : null }
164166
165- < Box mt = { 15 } className = { helpIconContainer } >
166- { helpResources . map ( ( data ) => (
167- < HelpCard key = { data . title } data = { data } />
168- ) ) }
169- </ Box >
167+ < Text className = { aboutTitle } > Need help?</ Text >
168+ < Text className = { aboutDescription } > Ensure uninterrupted deployment</ Text >
170169
170+ < Box mt = { 15 } className = { helpIconContainer } >
171+ { helpResources . map ( ( data ) => (
172+ < HelpCard key = { data . title } data = { data } />
173+ ) ) }
171174 </ Box >
172-
175+ </ Box >
173176 </ Modal >
174177 ) ;
175178} ;
0 commit comments