@@ -9,7 +9,7 @@ import { useImagesLibrary } from '../model' import { Swiper, SwiperSlide } from 'swiper/react' import 'swiper/css' import { useLibrarySwiper } from '../model/use-swiper' -import { ImageIcons } from '@/src/widgets/messages' +import { ImageIcons, useImageIcons } from '@/src/widgets/messages' import { Message } from '@/src/shared/lib/types/model' import { Typography } from '@mui/material' @@ -35,6 +35,8 @@ export default function FullScreenModal({ modal, setModal, current, images, onSl const { swiper, setSwiper, slideNext, slidePrev } = useLibrarySwiper(onSlideFalse, reverse) + const { downloadFile } = useImageIcons() + useEffect(() => { if (!(initialCount < images.length && swiper)) return @@ -69,15 +71,63 @@ export default function FullScreenModal({ modal, setModal, current, images, onSl opacity: 0.9, }} > -
setModal(false)}> - - - +
+
+ { + e.stopPropagation() + if (!swiper) return + const { file, content } = images[swiper.activeIndex] + downloadFile(file as string, content) + }} + width='24' + height='24' + viewBox='0 0 15 15' + fill='none' + xmlns='http://www.w3.org/2000/svg' + > + + +
+
+ { + e.stopPropagation() + if (!swiper) return + const { file } = images[swiper.activeIndex] + window.open(file as string, '_blank') + }} + width='24' + height='24' + viewBox='0 0 15 15' + fill='none' + xmlns='http://www.w3.org/2000/svg' + > + + +
+
setModal(false)}> + + + +