fix: model selector language undefined error (#23723)

This commit is contained in:
Wu Tianwei
2025-08-11 14:39:22 +08:00
committed by GitHub
parent 4a72fa6268
commit d30f898274

View File

@@ -1,6 +1,7 @@
import type { FC } from 'react' import type { FC } from 'react'
import { useEffect, useRef, useState } from 'react' import { useEffect, useRef, useState } from 'react'
import type { ModelParameterRule } from '../declarations' import type { ModelParameterRule } from '../declarations'
import { useLanguage } from '../hooks'
import { isNullOrUndefined } from '../utils' import { isNullOrUndefined } from '../utils'
import cn from '@/utils/classnames' import cn from '@/utils/classnames'
import Switch from '@/app/components/base/switch' import Switch from '@/app/components/base/switch'
@@ -26,6 +27,7 @@ const ParameterItem: FC<ParameterItemProps> = ({
onSwitch, onSwitch,
isInWorkflow, isInWorkflow,
}) => { }) => {
const language = useLanguage()
const [localValue, setLocalValue] = useState(value) const [localValue, setLocalValue] = useState(value)
const numberInputRef = useRef<HTMLInputElement>(null) const numberInputRef = useRef<HTMLInputElement>(null)