components.widgets.Cards.Card.jsx Maven / Gradle / Ivy
The newest version!
import React from 'react'
import classNames from 'classnames'
import PropTypes from 'prop-types'
import CardsCell from './CardsCell'
export function Card({ card, index, id, onResolve, dispatch, alignStyle, datasource, model = {} }) {
const { content = [], col } = card
return (
{content.map(({ component, className, style }) => {
if (!component) {
return null
}
const wrapperClassName = classNames(
'd-flex',
className,
{
'n2o-cards__image': component.src === 'ImageCell',
},
)
const { id: key } = model
return (
)
})}
)
}
Card.propTypes = {
card: PropTypes.object,
model: PropTypes.object,
index: PropTypes.number,
id: PropTypes.string,
onResolve: PropTypes.func,
dispatch: PropTypes.func,
alignStyle: PropTypes.object,
datasource: PropTypes.string,
}