mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-05 06:34:55 -05:00
44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
import { RootState, useAppSelector } from '../../app/store';
|
|
import CurrentImageButtons from './CurrentImageButtons';
|
|
import { MdPhoto } from 'react-icons/md';
|
|
import CurrentImagePreview from './CurrentImagePreview';
|
|
import ImageMetadataViewer from './ImageMetaDataViewer/ImageMetadataViewer';
|
|
|
|
/**
|
|
* Displays the current image if there is one, plus associated actions.
|
|
*/
|
|
const CurrentImageDisplay = () => {
|
|
const { currentImage, intermediateImage } = useAppSelector(
|
|
(state: RootState) => state.gallery
|
|
);
|
|
|
|
const shouldShowImageDetails = useAppSelector(
|
|
(state: RootState) => state.options.shouldShowImageDetails
|
|
);
|
|
|
|
const imageToDisplay = intermediateImage || currentImage;
|
|
|
|
return imageToDisplay ? (
|
|
<div className="current-image-display">
|
|
<div className="current-image-tools">
|
|
<CurrentImageButtons image={imageToDisplay} />
|
|
</div>
|
|
<div className="current-image-viewer">
|
|
<CurrentImagePreview imageToDisplay={imageToDisplay} />
|
|
{shouldShowImageDetails && (
|
|
<ImageMetadataViewer
|
|
image={imageToDisplay}
|
|
styleClass="current-image-metadata"
|
|
/>
|
|
)}
|
|
</div>
|
|
</div>
|
|
) : (
|
|
<div className="current-image-display-placeholder">
|
|
<MdPhoto />
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default CurrentImageDisplay;
|