11'use client'
22
3- import { useCallback , useMemo , useState } from 'react'
3+ import { useCallback , useState } from 'react'
44import {
55 Button ,
66 Combobox ,
@@ -42,6 +42,8 @@ interface DemoRequestFormState {
4242}
4343
4444const SUBMIT_SUCCESS_MESSAGE = "We'll be in touch soon!"
45+ const COMBOBOX_REGIONS = [ ...DEMO_REQUEST_REGION_OPTIONS ]
46+ const COMBOBOX_USER_COUNTS = [ ...DEMO_REQUEST_USER_COUNT_OPTIONS ]
4547
4648const INITIAL_FORM_STATE : DemoRequestFormState = {
4749 firstName : '' ,
@@ -61,9 +63,6 @@ export function DemoRequestModal({ children, theme = 'dark' }: DemoRequestModalP
6163 const [ submitError , setSubmitError ] = useState < string | null > ( null )
6264 const [ submitSuccess , setSubmitSuccess ] = useState ( false )
6365
64- const comboboxRegions = useMemo ( ( ) => [ ...DEMO_REQUEST_REGION_OPTIONS ] , [ ] )
65- const comboboxUserCounts = useMemo ( ( ) => [ ...DEMO_REQUEST_USER_COUNT_OPTIONS ] , [ ] )
66-
6766 const resetForm = useCallback ( ( ) => {
6867 setForm ( INITIAL_FORM_STATE )
6968 setErrors ( { } )
@@ -229,7 +228,7 @@ export function DemoRequestModal({ children, theme = 'dark' }: DemoRequestModalP
229228 < div className = 'grid gap-4 sm:grid-cols-2' >
230229 < FormField htmlFor = 'region' label = 'Region' error = { errors . region } >
231230 < Combobox
232- options = { comboboxRegions }
231+ options = { COMBOBOX_REGIONS }
233232 value = { form . region }
234233 selectedValue = { form . region }
235234 onChange = { ( value ) =>
@@ -242,7 +241,7 @@ export function DemoRequestModal({ children, theme = 'dark' }: DemoRequestModalP
242241 </ FormField >
243242 < FormField htmlFor = 'userCount' label = 'Number of users' error = { errors . userCount } >
244243 < Combobox
245- options = { comboboxUserCounts }
244+ options = { COMBOBOX_USER_COUNTS }
246245 value = { form . userCount }
247246 selectedValue = { form . userCount }
248247 onChange = { ( value ) =>
0 commit comments