import { Center, Flex, Image, Text, useColorModeValue } from '@chakra-ui/react'; import { useAppSelector } from '../../app/store'; import { RootState } from '../../app/store'; import { useState } from 'react'; import ImageMetadataViewer from './ImageMetadataViewer'; import CurrentImageButtons from './CurrentImageButtons'; // TODO: With CSS Grid I had a hard time centering the image in a grid item. This is needed for that. const height = 'calc(100vh - 238px)'; /** * Displays the current image if there is one, plus associated actions. */ const CurrentImageDisplay = () => { const { currentImage, intermediateImage } = useAppSelector( (state: RootState) => state.gallery ); const bgColor = useColorModeValue( 'rgba(255, 255, 255, 0.85)', 'rgba(0, 0, 0, 0.8)' ); const [shouldShowImageDetails, setShouldShowImageDetails] = useState(false); const imageToDisplay = intermediateImage || currentImage; return imageToDisplay ? (
{shouldShowImageDetails && ( )}
) : (
No image selected
); }; export default CurrentImageDisplay;