import React, { FC, useMemo } from 'react'; import { ImageSwitcher } from '../ImageSwitcher'; import * as styles from './styles.scss'; import { INode } from '~/redux/types'; import classNames from 'classnames'; import { getImageSize } from '~/utils/dom'; import { UPLOAD_TYPES } from '~/redux/uploads/constants'; interface IProps { is_loading: boolean; node: INode; } const NodeImageBlock: FC = ({ node, is_loading }) => { const images = useMemo( () => (node && node.files && node.files.filter(({ type }) => type === UPLOAD_TYPES.IMAGE)) || [], [node] ); return (
{!is_loading && (
{images.map(file => ( ))}
)}
); }; export { NodeImageBlock };