import React, { memo } from 'react'; import PropTypes from 'prop-types'; import { toString } from 'lodash'; import { IcoContainer } from 'strapi-helper-plugin'; import { useListView } from '../../contexts/ListView'; import CustomInputCheckbox from '../CustomInputCheckbox'; import { ActionContainer, Truncate, Truncated } from './styledComponents'; function Row({ isBulkable, row, headers }) { const { entriesToDelete, onChangeBulk, onClickDelete } = useListView(); return ( <> {isBulkable && ( e.stopPropagation()} key="i"> toString(id) === toString(row.id)) .length > 0 } /> )} {headers.map(header => { // return ( {row[header.name]} ); })} {} }, { id: row.id, icoType: 'trash', onClick: () => { onClickDelete(row.id); }, }, ]} /> ); } Row.propTypes = { headers: PropTypes.array.isRequired, isBulkable: PropTypes.bool.isRequired, row: PropTypes.object.isRequired, }; export default memo(Row);