|
| 1 | +import React, { Fragment, useState } from 'react'; |
| 2 | +import { PropTypes } from 'prop-types'; |
| 3 | +import { Dialog, Transition, Listbox } from '@headlessui/react'; |
| 4 | +import Button from 'components/atoms/common/Button'; |
| 5 | +import { BUTTON_INTENT_TYPES, BUTTON_TYPES, GENAI_MODELS } from 'constants/Common'; |
| 6 | +import { CheckIcon, ChevronUpDownIcon } from '@heroicons/react/20/solid'; |
| 7 | +import { Square3Stack3DIcon } from '@heroicons/react/24/outline'; |
| 8 | +import { generateFlowData } from '../flow/flowtestai'; |
| 9 | +import { init } from '../flow'; |
| 10 | +import useCanvasStore from 'stores/CanvasStore'; |
| 11 | +import { toast } from 'react-toastify'; |
| 12 | +import { isEqual } from 'lodash'; |
| 13 | +import useCommonStore from 'stores/CommonStore'; |
| 14 | +import useCollectionStore from 'stores/CollectionStore'; |
| 15 | +import { promiseWithTimeout } from 'utils/common'; |
| 16 | +import { Editor } from 'components/atoms/Editor'; |
| 17 | + |
| 18 | +const OuputNodeExpandedModal = ({ closeFn = () => null, open = false, data }) => { |
| 19 | + return ( |
| 20 | + <Transition appear show={open} as={Fragment}> |
| 21 | + <Dialog as='div' className='relative z-10' onClose={closeFn}> |
| 22 | + <Transition.Child |
| 23 | + as={Fragment} |
| 24 | + enter='ease-out duration-300' |
| 25 | + enterFrom='opacity-0' |
| 26 | + enterTo='opacity-100' |
| 27 | + leave='ease-in duration-200' |
| 28 | + leaveFrom='opacity-100' |
| 29 | + leaveTo='opacity-0' |
| 30 | + > |
| 31 | + <div className='fixed inset-0 bg-black/25' /> |
| 32 | + </Transition.Child> |
| 33 | + |
| 34 | + <div className='fixed inset-0 overflow-y-auto'> |
| 35 | + <div className='flex items-center justify-center min-h-full p-4 text-center'> |
| 36 | + <Transition.Child |
| 37 | + as={Fragment} |
| 38 | + enter='ease-out duration-300' |
| 39 | + enterFrom='opacity-0 scale-95' |
| 40 | + enterTo='opacity-100 scale-100' |
| 41 | + leave='ease-in duration-200' |
| 42 | + leaveFrom='opacity-100 scale-100' |
| 43 | + leaveTo='opacity-0 scale-95' |
| 44 | + > |
| 45 | + <Dialog.Panel className='w-full max-w-2xl p-6 overflow-hidden text-left align-middle transition-all transform bg-white rounded shadow-xl'> |
| 46 | + <Dialog.Title as='h3' className='pb-4 text-lg font-semibold text-center border-b border-gray-300'> |
| 47 | + Ouput |
| 48 | + </Dialog.Title> |
| 49 | + <div className='mt-6'> |
| 50 | + <Editor name='output-text' value={JSON.stringify(data, null, 2)} readOnly={true} /> |
| 51 | + </div> |
| 52 | + </Dialog.Panel> |
| 53 | + </Transition.Child> |
| 54 | + </div> |
| 55 | + </div> |
| 56 | + </Dialog> |
| 57 | + </Transition> |
| 58 | + ); |
| 59 | +}; |
| 60 | + |
| 61 | +OuputNodeExpandedModal.propTypes = { |
| 62 | + closeFn: PropTypes.func.isRequired, |
| 63 | + open: PropTypes.boolean.isRequired, |
| 64 | +}; |
| 65 | +export default OuputNodeExpandedModal; |
0 commit comments