|
1 | 1 | import { Dialog, Transition } from '@headlessui/react'
|
2 | 2 | import { Dispatch, Fragment, SetStateAction } from 'react'
|
3 | 3 | import CloseIcon from '../icons/CloseIcon'
|
4 |
| -import Spinner from './Spinner' |
5 | 4 |
|
6 | 5 | const Modal: React.FC<{
|
7 | 6 | isModalOpen: boolean
|
8 | 7 | setIsModalOpen: Dispatch<SetStateAction<boolean>>
|
9 | 8 | closeModal: () => void
|
10 |
| - changes: any |
11 |
| - handleSendProposalButtonClick: () => void |
12 |
| - isSendProposalButtonLoading: boolean |
13 |
| -}> = ({ |
14 |
| - isModalOpen, |
15 |
| - setIsModalOpen, |
16 |
| - closeModal, |
17 |
| - changes, |
18 |
| - handleSendProposalButtonClick, |
19 |
| - isSendProposalButtonLoading, |
20 |
| -}) => { |
| 9 | + content: any |
| 10 | +}> = ({ isModalOpen, setIsModalOpen, closeModal, content }) => { |
21 | 11 | return (
|
22 | 12 | <Transition appear show={isModalOpen} as={Fragment}>
|
23 | 13 | <Dialog
|
24 | 14 | as="div"
|
25 |
| - className="relative z-10" |
| 15 | + className="relative z-40" |
26 | 16 | onClose={() => setIsModalOpen(false)}
|
27 | 17 | >
|
28 | 18 | <Transition.Child
|
@@ -55,40 +45,7 @@ const Modal: React.FC<{
|
55 | 45 | <Dialog.Title as="h3" className="diaglogTitle">
|
56 | 46 | Proposed Changes
|
57 | 47 | </Dialog.Title>
|
58 |
| - |
59 |
| - {!changes ? ( |
60 |
| - <p className="mb-8 leading-6 ">No proposed changes.</p> |
61 |
| - ) : ( |
62 |
| - Object.keys(changes).map((key) => { |
63 |
| - if (changes[key].prev !== changes[key].new) { |
64 |
| - return ( |
65 |
| - <div |
66 |
| - key={key} |
67 |
| - className="flex items-center justify-between pb-4" |
68 |
| - > |
69 |
| - <span className="pr-4 text-left font-bold"> |
70 |
| - {key} |
71 |
| - </span> |
72 |
| - <span className="mr-2"> |
73 |
| - {changes[key].prev} → {changes[key].new} |
74 |
| - </span> |
75 |
| - </div> |
76 |
| - ) |
77 |
| - } |
78 |
| - }) |
79 |
| - )} |
80 |
| - |
81 |
| - <button |
82 |
| - className="action-btn text-base " |
83 |
| - onClick={handleSendProposalButtonClick} |
84 |
| - disabled={!changes} |
85 |
| - > |
86 |
| - {isSendProposalButtonLoading ? ( |
87 |
| - <Spinner /> |
88 |
| - ) : ( |
89 |
| - 'Send Proposal' |
90 |
| - )} |
91 |
| - </button> |
| 48 | + {content} |
92 | 49 | </div>
|
93 | 50 | </Dialog.Panel>
|
94 | 51 | </Transition.Child>
|
|
0 commit comments