import React from 'react'; import PropTypes from 'prop-types'; import { Checkbox } from '@buffetjs/core'; import { createMatrix } from '../../utils'; import Card from '../Card'; import CardControlsWrapper from '../CardControlsWrapper'; import Wrapper from './Wrapper'; const List = ({ data, onChange, selectedItems }) => { const matrix = createMatrix(data); return ( {matrix.map(({ key, rowContent }) => { return (
{rowContent.map(item => { const { id, url } = item; const checked = selectedItems.includes(`${id}`); return (
); })}
); })}
); }; List.defaultProps = { data: [], onChange: () => {}, selectedItems: [], }; List.propTypes = { data: PropTypes.array, onChange: PropTypes.func, selectedItems: PropTypes.array, }; export default List;