@@ -16,12 +16,12 @@ import { useDebouncedCallback } from 'use-debounce'
|
||||
import { env } from 'utils'
|
||||
import { MoreInfoTooltip } from '../MoreInfoTooltip'
|
||||
|
||||
type Value<HasVariable> = HasVariable extends undefined | true
|
||||
type Value<HasVariable> = HasVariable extends true | undefined
|
||||
? number | VariableString
|
||||
: number
|
||||
|
||||
type Props<HasVariable extends boolean> = {
|
||||
defaultValue?: Value<HasVariable>
|
||||
defaultValue: Value<HasVariable> | undefined
|
||||
debounceTimeout?: number
|
||||
withVariableButton?: HasVariable
|
||||
label?: string
|
||||
|
||||
@@ -3,6 +3,7 @@ import { injectVariableInText } from '@/features/variables/utils/injectVariableI
|
||||
import { focusInput } from '@/utils/focusInput'
|
||||
import {
|
||||
FormControl,
|
||||
FormHelperText,
|
||||
FormLabel,
|
||||
HStack,
|
||||
Input as ChakraInput,
|
||||
@@ -26,6 +27,7 @@ export type TextInputProps = {
|
||||
onChange: (value: string) => void
|
||||
debounceTimeout?: number
|
||||
label?: ReactNode
|
||||
helperText?: ReactNode
|
||||
moreInfoTooltip?: string
|
||||
withVariableButton?: boolean
|
||||
isRequired?: boolean
|
||||
@@ -42,6 +44,7 @@ export const TextInput = forwardRef(function TextInput(
|
||||
defaultValue,
|
||||
debounceTimeout = 1000,
|
||||
label,
|
||||
helperText,
|
||||
moreInfoTooltip,
|
||||
withVariableButton = true,
|
||||
isRequired,
|
||||
@@ -137,6 +140,7 @@ export const TextInput = forwardRef(function TextInput(
|
||||
) : (
|
||||
Input
|
||||
)}
|
||||
{helperText && <FormHelperText>{helperText}</FormHelperText>}
|
||||
</FormControl>
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user