chore: change forward ref to new ref

This commit is contained in:
Joel
2025-02-07 16:43:10 +08:00
parent eeb1ed486a
commit dbd5e8d7a0
357 changed files with 3415 additions and 1964 deletions

View File

@ -1,11 +1,4 @@
import {
forwardRef,
memo,
useCallback,
useEffect,
useImperativeHandle,
useMemo,
} from 'react'
import { memo, useCallback, useEffect, useImperativeHandle, useMemo } from 'react'
import { useNodes } from 'reactflow'
import { BlockEnum } from '../../types'
import {
@ -35,12 +28,17 @@ type ChatWrapperProps = {
onHide: () => void
}
const ChatWrapper = forwardRef<ChatWrapperRefType, ChatWrapperProps>(({
showConversationVariableModal,
onConversationModalHide,
showInputsFieldsPanel,
onHide,
}, ref) => {
const ChatWrapper = (
{
ref,
showConversationVariableModal,
onConversationModalHide,
showInputsFieldsPanel,
onHide,
}: ChatWrapperProps & {
ref: React.RefObject<ChatWrapperRefType>;
},
) => {
const nodes = useNodes<StartNodeType>()
const startNode = nodes.find(node => node.data.type === BlockEnum.Start)
const startVariables = startNode?.data.variables
@ -168,7 +166,7 @@ const ChatWrapper = forwardRef<ChatWrapperRefType, ChatWrapperProps>(({
)}
</>
)
})
}
ChatWrapper.displayName = 'ChatWrapper'

View File

@ -85,7 +85,7 @@ const DebugAndPreview = () => {
<RiEqualizer2Line className='w-4 h-4' />
</ActionButton>
</Tooltip>
{expanded && <div className='absolute z-10 bottom-[-17px] right-[5px] w-3 h-3 bg-components-panel-on-panel-item-bg border-l-[0.5px] border-t-[0.5px] border-components-panel-border-subtle rotate-45'/>}
{expanded && <div className='absolute z-10 bottom-[-17px] right-[5px] w-3 h-3 bg-components-panel-on-panel-item-bg border-l-[0.5px] border-t-[0.5px] border-components-panel-border-subtle rotate-45' />}
</div>
)}
<div className='mx-3 w-[1px] h-3.5 bg-gray-200'></div>