1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00
vault-frontend/src/components/node/NodeAudioImageBlock/index.tsx
2022-01-02 18:17:09 +07:00

28 lines
849 B
TypeScript

import React, { FC, useMemo } from 'react';
import { INode } from '~/redux/types';
import styles from './styles.module.scss';
import { UPLOAD_TYPES } from '~/redux/uploads/constants';
import { path } from 'ramda';
import { getURL } from '~/utils/dom';
import { PRESETS } from '~/constants/urls';
import { INodeComponentProps } from '~/redux/node/constants';
import { useNodeImages } from '~/hooks/node/useNodeImages';
interface IProps extends INodeComponentProps {}
const NodeAudioImageBlock: FC<IProps> = ({ node }) => {
const images = useNodeImages(node);
if (images.length === 0) return null;
return (
<div className={styles.wrap}>
<div
className={styles.slide}
style={{ backgroundImage: `url("${getURL(path([0], images), PRESETS.small_hero)}")` }}
/>
</div>
);
};
export { NodeAudioImageBlock };