mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-28 05:10:17 +08:00
20 lines
390 B
JavaScript
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;
|