split hooks

This commit is contained in:
StyleZhang
2024-03-13 11:53:21 +08:00
parent 64fa343d16
commit a55a7603dd
25 changed files with 586 additions and 491 deletions

View File

@ -3,7 +3,7 @@ import type { FC } from 'react'
import React, { useCallback } from 'react'
import produce from 'immer'
import { useTranslation } from 'react-i18next'
import { useWorkflow } from '../../../hooks'
import { useEdgesInteractions } from '../../../hooks'
import AddButton from '../../_base/components/add-button'
import Item from './class-item'
import type { Topic } from '@/app/components/workflow/nodes/question-classifier/types'
@ -22,7 +22,7 @@ const ClassList: FC<Props> = ({
onChange,
}) => {
const { t } = useTranslation()
const { handleEdgeDeleteByDeleteBranch } = useWorkflow()
const { handleEdgeDeleteByDeleteBranch } = useEdgesInteractions()
const handleClassChange = useCallback((index: number) => {
return (value: Topic) => {