1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-26 05:16:41 +07:00
vault-frontend/src/components/node/NodeRelated/index.tsx
2020-11-06 12:15:07 +07:00

28 lines
734 B
TypeScript

import React, { FC, ReactElement } from 'react';
import styles from './styles.module.scss';
import { Group } from '~/components/containers/Group';
import { INode } from '~/redux/types';
import { NodeRelatedItem } from '~/components/node/NodeRelatedItem';
interface IProps {
title: ReactElement | string;
items: Partial<INode>[];
}
const NodeRelated: FC<IProps> = ({ title, items }) => {
return (
<Group className={styles.wrap}>
<div className={styles.title}>
<div className={styles.text}>{title}</div>
</div>
<div className={styles.grid}>
{items.map(item => (
<NodeRelatedItem item={item} key={item.id} />
))}
</div>
</Group>
);
};
export { NodeRelated };