File indexing completed on 2025-05-04 05:30:58

0001 import React from 'react'
0002 import SearchProductInput from './SearchProductInput';
0003 const ModalAddRelationship = (props) => {
0004     return (
0005         <div className="modal fade " id="productRelationshipPanel" tabindex="-1" data-keyboard="false" role="dialog" aria-labelledby="productRelationshipPanelModalLabel" aria-hidden="true">
0006         <div className="modal-dialog " role="document" style={{width:'1000px'}}>
0007         <form name="form-add-product-relationship" onSubmit={props.handleSubmit}>
0008           <div className="modal-content">
0009             <div className="modal-header">              
0010               <button type="button" className="close" data-dismiss="modal" aria-label="Close">
0011                 <span aria-hidden="true">&times;</span>
0012               </button>
0013               <h5 className="modal-title" id="productRelationshipPanelModalLabel">Add Relationship</h5>
0014             </div>
0015             <div className="modal-body">
0016                 <div style={{display:'flex'}}>
0017                   <div style={{borderRight:'1px solid #ccc',textAlign:'center', paddingRight:'20px',minHeight:'300px'}}>
0018                       <h4>
0019                         {props.product.title}
0020                       </h4>
0021                       <img src={props.product.image_small_absolute} style={{width:'400px'}}></img>                      
0022                       <span style={{ fontSize: '11px', color: '#ccc',lineHeight:'15px',display:'inherit' }}>
0023                       {props.product.cat_title}</span>    
0024                   </div>
0025                   <div>
0026                     
0027                       <div className="container" style={{width:'500px'}}>                        
0028                         <SearchProductInput baseUrlStore={window.config.baseUrlStore} 
0029                             searchbaseurl = {window.config.searchbaseurl}
0030                             product ={props.product}   
0031                             project_id={props.project_id}                          
0032                             setProjectId={props.setProjectId}
0033                             handleInputProjectIdChange={props.handleInputProjectIdChange}
0034                             />  
0035 
0036                         <div className="row">
0037                                   <div className="col-lg-12"><h6>Message (optional): </h6> </div>
0038                                   <div className="col-lg-12">
0039                                     <textarea name="message" id="message" value={props.message} 
0040                                         onChange={props.handleChangeMessage}
0041                                       style={{width:'310px'}} />
0042                                 </div>
0043                         </div>
0044 
0045                         <div className="row"> 
0046                         <div className="col-lg-12" style={{paddingTop:'20px'}}>
0047                           <span>The product above is </span>
0048                         <fieldset>
0049                             <input type="radio" id="mc" name="type" value="is-original" 
0050                             checked={props.radioType === "is-original"}                           
0051                             onChange={props.handleRadioChange}
0052                             />
0053                             <label for="mc"> original </label> 
0054                             <span> or </span>
0055                             <input type="radio" id="mc2" name="type" value="is-clone" 
0056                             checked={props.radioType === "is-clone"}   
0057                             onChange={props.handleRadioChange}                         
0058                             />
0059                             <label for="mc2"> clone </label> 
0060                             {/*
0061                             <input type="radio" id="vi" name="type" value="is-sibling" checked={radioType === "is-sibling"}
0062                               onClick={handleRadioChange}
0063                             />
0064                             <label for="vi"> Is sibling</label> 
0065                             */}
0066                             <br></br>                         
0067                             <span> of the product on left side.</span>
0068                           </fieldset>
0069                           </div>
0070                         </div>
0071                       
0072                       </div>
0073                     
0074                       
0075                   
0076                   </div>
0077                 </div>
0078                 
0079 
0080             </div>
0081             <div className="modal-footer">
0082 
0083                 
0084                 <>
0085                 <span dangerouslySetInnerHTML={{__html: props.response.message}}></span>                 
0086                 </>
0087               
0088 
0089               <button type="button" className="btn btn-primary" data-dismiss="modal" onClick={props.handleOnCloseModal}>Close</button>              
0090               {!props.succeed &&
0091               <button type="submit" className="btn btn-primary" >Add relationship</button>             
0092               }
0093             </div>
0094           </div>
0095         </form>
0096         </div>
0097       </div>
0098     )
0099 }
0100 
0101 
0102 export default ModalAddRelationship;