2018-04-21 01:47:30 +03:00

20 lines
390 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
function Image({ src, alt, presentation }) {
return <img src={src} alt={alt} role={presentation && 'presentation'} />;
}
Image.propTypes = {
src: PropTypes.string.isRequired,
alt: PropTypes.string,
presentation: PropTypes.bool,
};
Image.defaultProps = {
alt: null,
presentation: false,
};
export default Image;