Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

Commit b0adb77

Browse files
committed
capture a 'token' value
1 parent ab3ab20 commit b0adb77

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/react-ezql/src/App.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ const TRIGGERS = ['KeyK', 'Slash']
66

77
function App() {
88
const [shouldDisplayEzql, setShouldDisplayEzql] = useState(false)
9+
const [token, setToken] = useState<string>('')
10+
911
const suggestions = ['How many books sold last week', 'How many new users signed up today']
1012

1113
// listen for the trigger to display the modal
@@ -27,12 +29,21 @@ function App() {
2729

2830
return (
2931
<>
30-
<p>
32+
<p className="text-center text-gray-400 my-2">
3133
Press <i>Command-K</i> to display EZQL, <i>Escape</i> to dismiss.
3234
</p>
3335

36+
<p className='mx-2 flex items-center'>
37+
<label>Token</label>
38+
<input
39+
className="bg-gray-50 rounded-sm ml-4 border border-gray-200 p-1 flex-1"
40+
onChange={(event) => setToken(event.target.value)}
41+
/>
42+
</p>
43+
3444
{shouldDisplayEzql && (
3545
<EzqlPrompt
46+
token={token}
3647
setShouldDisplayEzql={setShouldDisplayEzql}
3748
suggestions={suggestions}
3849
didSubmitWithValue={(value) => {

src/react-ezql/src/components/ezql-prompt.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { classNames } from '../lib/class-names'
66
import styles from './ezql-prompt.module.css'
77

88
export type EzqlPromptOpts = {
9+
token: string
910
setShouldDisplayEzql: (value: boolean) => void
1011
onResults: (data: object) => void
1112
didSubmitWithValue?: (query: string) => void
@@ -14,6 +15,7 @@ export type EzqlPromptOpts = {
1415
}
1516

1617
export default function EzqlPrompt({
18+
token,
1719
setShouldDisplayEzql,
1820
didSubmitWithValue,
1921
onResults,

0 commit comments

Comments
 (0)