| 1 |
import React from 'react'; |
| 2 |
import Media from 'Modal/general/Media'; |
| 3 |
|
| 4 |
const PropertyImage = (props) => { |
| 5 |
const hasImage = 0 < parseInt( props.value ); |
| 6 |
|
| 7 |
return ( |
| 8 |
<a href="#" onClick={(e) => { |
| 9 |
e.preventDefault(); |
| 10 |
|
| 11 |
Media.selectImage((attachment) => { |
| 12 |
props.onValueChange( '' + attachment.id ); // Needs to be a string. |
| 13 |
}); |
| 14 |
}}>{ hasImage ? 'Change...' : 'Select...' }</a> |
| 15 |
); |
| 16 |
} |
| 17 |
|
| 18 |
export default PropertyImage; |