@@ -16,6 +16,10 @@ position: relative; border-radius: 15px; + &_disabled { + cursor: default; + } + @media screen and (max-width: 1000px) { width: 291px; height: 291px; @@ -10,6 +10,7 @@ import Image from 'next/image' import { useMediaQuery } from 'usehooks-ts' import { useEventStore } from '#/shared/lib/event-source' import { eventBus } from '#/shared/classes' +import { GALLERY_IMAGES, getModalById } from '#/features/modals' interface FileImageMessageProps extends Message {} @@ -20,19 +21,29 @@ export const FileImageMessage = ({ file, content, uid, ...message }: FileImageMe const [loaded, setLoaded] = useState(false) + const [error, setError] = useState(false) + const [hasEvent, setHasEvent] = useState(false) + const modal = getModalById(GALLERY_IMAGES) + useEffect(() => { eventBus.subscribe(`image-generate-${uid}`, (data) => { setHasEvent(data) }) }, []) + const text = useMemo(() => (error ? 'Ошибка загрузки' : 'Изображение загружается'), [error]) + return ( - - +