@@ -164,54 +164,72 @@ const BulkSendUi = (props) => {
164
164
> </ div >
165
165
</ div >
166
166
) }
167
- < form onSubmit = { handleSubmit } >
168
- < div className = " min-h-max max-h-[250px] overflow-y-auto" >
169
- { forms ?. map ( ( form , index ) => (
170
- < div
171
- key = { form . Id }
172
- className = "p-3 rounded-xl border-[1px] border-gray-400 m-4 bg-white text-black grid grid-cols-1 md:grid-cols-2 gap-2 relative"
173
- >
174
- { form ?. fields ?. map ( ( field , fieldIndex ) => (
175
- < div className = "flex flex-col " key = { field . fieldId } >
176
- < label > { field . label } </ label >
177
- < SuggestionInput
178
- required
179
- type = "email"
180
- value = { field . value }
181
- index = { fieldIndex }
182
- onChange = { ( signer ) =>
183
- handleInputChange ( index , signer , fieldIndex )
184
- }
185
- />
186
- </ div >
187
- ) ) }
188
- { index > 0 && (
167
+ { props . Placeholders ?. length > 0 ? (
168
+ < >
169
+ { props . Placeholders ?. some ( ( x ) => ! x . signerObjId ) ? (
170
+ < form onSubmit = { handleSubmit } >
171
+ < div className = " min-h-max max-h-[250px] overflow-y-auto" >
172
+ { forms ?. map ( ( form , index ) => (
173
+ < div
174
+ key = { form . Id }
175
+ className = "p-3 rounded-xl border-[1px] border-gray-400 m-4 bg-white text-black grid grid-cols-1 md:grid-cols-2 gap-2 relative"
176
+ >
177
+ { form ?. fields ?. map ( ( field , fieldIndex ) => (
178
+ < div className = "flex flex-col " key = { field . fieldId } >
179
+ < label > { field . label } </ label >
180
+ < SuggestionInput
181
+ required
182
+ type = "email"
183
+ value = { field . value }
184
+ index = { fieldIndex }
185
+ onChange = { ( signer ) =>
186
+ handleInputChange ( index , signer , fieldIndex )
187
+ }
188
+ />
189
+ </ div >
190
+ ) ) }
191
+ { forms ?. length > 1 && (
192
+ < button
193
+ onClick = { ( ) => handleRemoveForm ( index ) }
194
+ className = "absolute right-3 top-1 border border-gray-300 rounded-lg px-2 py-1"
195
+ >
196
+ < i className = "fa-solid fa-trash" > </ i >
197
+ </ button >
198
+ ) }
199
+ < div ref = { formRef } > </ div >
200
+ </ div >
201
+ ) ) }
202
+ </ div >
203
+ < div className = "flex flex-col mx-4 mb-4 gap-3" >
189
204
< button
190
- onClick = { ( ) => handleRemoveForm ( index ) }
191
- className = "absolute right-3 top-1 border border-gray-300 rounded-lg px-2 py-1 "
205
+ onClick = { handleAddForm }
206
+ className = "bg-[#32a3ac] p-2 text-white w-full rounded-full focus:outline-none "
192
207
>
193
- < i className = "fa-solid fa-trash " > </ i >
208
+ < i className = "fa-solid fa-plus " > </ i > < span > Add new </ span >
194
209
</ button >
195
- ) }
196
- < div ref = { formRef } > </ div >
210
+ < button
211
+ type = "submit"
212
+ className = "bg-[#32a3ac] p-2 text-white w-full rounded-full focus:outline-none"
213
+ >
214
+ < i className = "fa-solid fa-paper-plane" > </ i > < span > Send</ span >
215
+ </ button >
216
+ </ div >
217
+ </ form >
218
+ ) : (
219
+ < div className = "text-black p-3 bg-white w-full text-sm md:text-base flex justify-center items-center" >
220
+ All roles in this document are currently linked to contacts. To
221
+ 'quick send' copies of this template to multiple
222
+ signers, please ensure that at least one role is not linked to any
223
+ contact.
197
224
</ div >
198
- ) ) }
225
+ ) }
226
+ </ >
227
+ ) : (
228
+ < div className = "text-black p-3 bg-white w-full text-sm md:text-base flex justify-center items-center" >
229
+ Please add at least one role to this template in order to 'quick
230
+ send' copies of it to multiple signers.
199
231
</ div >
200
- < div className = "flex flex-col mx-4 mb-4 gap-3" >
201
- < button
202
- onClick = { handleAddForm }
203
- className = "bg-[#32a3ac] p-2 text-white w-full rounded-full focus:outline-none"
204
- >
205
- < i className = "fa-solid fa-plus" > </ i > < span > Add new</ span >
206
- </ button >
207
- < button
208
- type = "submit"
209
- className = "bg-[#32a3ac] p-2 text-white w-full rounded-full focus:outline-none"
210
- >
211
- < i className = "fa-solid fa-paper-plane" > </ i > < span > Send</ span >
212
- </ button >
213
- </ div >
214
- </ form >
232
+ ) }
215
233
</ >
216
234
) ;
217
235
} ;
0 commit comments