Skip to content

Commit 5a61b3f

Browse files
committed
examples now collapse on frontend app
1 parent c05718f commit 5a61b3f

File tree

1 file changed

+23
-13
lines changed
  • interactive-ai-holograms/react-client/react-client/src

1 file changed

+23
-13
lines changed

interactive-ai-holograms/react-client/react-client/src/App.tsx

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from "react";
1+
import React, { useState } from "react";
22
import "./App.css";
33
import {
44
AIServiceSpeechRealtimeApi,
@@ -257,23 +257,33 @@ function App() {
257257
setErrors([]);
258258
};
259259

260+
261+
const [isQuestionsVisible, setIsQuestionsVisible] = useState(false);
262+
263+
const toggleQuestionsVisibility = () => {
264+
setIsQuestionsVisible(!isQuestionsVisible);
265+
};
266+
260267
return (
261268
<div className="App">
262269
<div>
263270
<h3>Interactive AI Holograms</h3>
264271
<h5>Click 'Start session' and ask DeeBee/DB a question. </h5>
265-
<br />
266-
<h5>Examples...</h5>
267-
'What is the latest version of the Oracle Database?'
268-
<br />
269-
'What is the latest version of the Oracle Database? Use Rag.'
270-
<br />
271-
'Whats is the best video game?'
272-
<br />
273-
'Whats is the best video game. Use Database'
274-
<br />
275-
'What is Oracle for Startups? Use Database'
276-
<br />
272+
<button onClick={toggleQuestionsVisibility}>
273+
{isQuestionsVisible ? 'Hide Examples' : 'Show Examples'}
274+
</button>
275+
{isQuestionsVisible && (
276+
<div>
277+
<h5>Examples...</h5>
278+
<ul>
279+
<li>'What is the latest version of the Oracle Database?'</li>
280+
<li>'What is the latest version of the Oracle Database? Use Rag.'</li>
281+
<li>'What is the best video game?'</li>
282+
<li>'What is the best video game? Use Database'</li>
283+
<li>'What is Oracle for Startups? Use Database'</li>
284+
</ul>
285+
</div>
286+
)}
277287
<span>
278288
<button onClick={() => (buttonState ? stopSession() : startSession())}>
279289
{buttonState ? "Stop Session and Submit Question" : "Start session and Ask Question"}

0 commit comments

Comments
 (0)