const React = require('react'); const PropTypes = require('prop-types'); const classnames = require('classnames'); const Icon = require('stremio-icons/dom'); const Button = require('stremio/common/Button'); const MetaItem = require('stremio/common/MetaItem'); const CONSTANTS = require('stremio/common/CONSTANTS'); const MetaRowPlaceholder = require('./MetaRowPlaceholder'); const styles = require('./styles'); const MetaRow = ({ className, title, message, items, href }) => { return (
{ (typeof title === 'string' && title.length > 0) || (typeof href === 'string' && href.length > 0) ?
{ typeof title === 'string' && title.length > 0 ?
{title}
: null } { typeof href === 'string' && href.length > 0 ? : null }
: null } { typeof message === 'string' && message.length > 0 ?
{message}
:
{items.slice(0, CONSTANTS.CATALOG_PREVIEW_SIZE).map((item, index) => ( ))} {Array(Math.max(0, CONSTANTS.CATALOG_PREVIEW_SIZE - items.length)).fill(null).map((_, index) => (
))}
}
); }; MetaRow.Placeholder = MetaRowPlaceholder; MetaRow.propTypes = { className: PropTypes.string, title: PropTypes.string, message: PropTypes.string, items: PropTypes.arrayOf(PropTypes.shape({ posterShape: PropTypes.string })), href: PropTypes.string }; module.exports = MetaRow;