Skip to content

Commit 4cf445f

Browse files
author
Theodore Li
committed
Address greptile comments
1 parent c24c6d6 commit 4cf445f

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

apps/sim/app/(home)/components/demo-request/demo-request-modal.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22

3-
import { useCallback, useMemo, useState } from 'react'
3+
import { useCallback, useState } from 'react'
44
import {
55
Button,
66
Combobox,
@@ -42,6 +42,8 @@ interface DemoRequestFormState {
4242
}
4343

4444
const 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

4648
const 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) =>

apps/sim/components/emcn/components/form-field/form-field.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client'
22

33
import type { ReactNode } from 'react'
4-
import { Label } from '../label/label'
4+
import { Label } from '@/components/emcn'
55

66
export interface FormFieldProps {
77
label: ReactNode

0 commit comments

Comments
 (0)