diff --git a/web/app/components/rag-pipeline/components/input-field/editor/dialog-wrapper.tsx b/web/app/components/rag-pipeline/components/input-field/editor/dialog-wrapper.tsx new file mode 100644 index 0000000000..c3c877eaf4 --- /dev/null +++ b/web/app/components/rag-pipeline/components/input-field/editor/dialog-wrapper.tsx @@ -0,0 +1,54 @@ +import { Fragment, useCallback } from 'react' +import type { ReactNode } from 'react' +import { Dialog, DialogPanel, Transition, TransitionChild } from '@headlessui/react' +import cn from '@/utils/classnames' + +type DialogWrapperProps = { + className?: string + panelWrapperClassName?: string + children: ReactNode + show: boolean + onClose?: () => void +} + +const DialogWrapper = ({ + className, + panelWrapperClassName, + children, + show, + onClose, +}: DialogWrapperProps) => { + const close = useCallback(() => onClose?.(), [onClose]) + return ( + + + +
+ + +
+
+ + + {children} + + +
+
+
+
+ ) +} + +export default DialogWrapper diff --git a/web/app/components/rag-pipeline/components/input-field/editor/index.tsx b/web/app/components/rag-pipeline/components/input-field/editor/index.tsx index 5641400e3e..77882f0259 100644 --- a/web/app/components/rag-pipeline/components/input-field/editor/index.tsx +++ b/web/app/components/rag-pipeline/components/input-field/editor/index.tsx @@ -1,5 +1,5 @@ import { RiCloseLine } from '@remixicon/react' -import DialogWrapper from '../dialog-wrapper' +import DialogWrapper from './dialog-wrapper' import InputFieldForm from './form' import { convertToInputFieldFormData } from './utils' import { useCallback } from 'react' @@ -60,27 +60,24 @@ const InputFieldEditor = ({ -
-
- {initialData ? t('datasetPipeline.inputFieldPanel.editInputField') : t('datasetPipeline.inputFieldPanel.addInputField')} -
- - +
+ {initialData ? t('datasetPipeline.inputFieldPanel.editInputField') : t('datasetPipeline.inputFieldPanel.addInputField')}
+ + ) }