chore: show credit help link (#2393)
This commit is contained in:
@@ -98,6 +98,7 @@ export type CredentialFormSchemaBase = {
|
||||
default?: string
|
||||
tooltip?: TypeWithI18N
|
||||
show_on: FormShowOnObject[]
|
||||
url?: string
|
||||
}
|
||||
|
||||
export type CredentialFormSchemaTextInput = CredentialFormSchemaBase & { max_length?: number; placeholder?: TypeWithI18N }
|
||||
|
||||
@@ -28,6 +28,7 @@ type FormProps = {
|
||||
readonly?: boolean
|
||||
inputClassName?: string
|
||||
isShowDefaultValue?: boolean
|
||||
fieldMoreInfo?: (payload: CredentialFormSchema) => JSX.Element | null
|
||||
}
|
||||
|
||||
const Form: FC<FormProps> = ({
|
||||
@@ -41,6 +42,7 @@ const Form: FC<FormProps> = ({
|
||||
readonly,
|
||||
inputClassName,
|
||||
isShowDefaultValue = false,
|
||||
fieldMoreInfo,
|
||||
}) => {
|
||||
const language = useLanguage()
|
||||
const [changeKey, setChangeKey] = useState('')
|
||||
@@ -106,6 +108,7 @@ const Form: FC<FormProps> = ({
|
||||
type={formSchema.type === FormTypeEnum.textNumber ? 'number' : 'text'}
|
||||
{...(formSchema.type === FormTypeEnum.textNumber ? { min: (formSchema as CredentialFormSchemaNumberInput).min, max: (formSchema as CredentialFormSchemaNumberInput).max } : {})}
|
||||
/>
|
||||
{fieldMoreInfo?.(formSchema)}
|
||||
{validating && changeKey === variable && <ValidatingTip />}
|
||||
</div>
|
||||
)
|
||||
@@ -162,6 +165,7 @@ const Form: FC<FormProps> = ({
|
||||
))
|
||||
}
|
||||
</div>
|
||||
{fieldMoreInfo?.(formSchema)}
|
||||
{validating && changeKey === variable && <ValidatingTip />}
|
||||
</div>
|
||||
)
|
||||
@@ -205,6 +209,7 @@ const Form: FC<FormProps> = ({
|
||||
onSelect={item => handleFormChange(variable, item.value as string)}
|
||||
placeholder={placeholder?.[language]}
|
||||
/>
|
||||
{fieldMoreInfo?.(formSchema)}
|
||||
{validating && changeKey === variable && <ValidatingTip />}
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user