// Copyright (C) 2017-2023 Smart code 203358507
const React = require('react');
const PropTypes = require('prop-types');
const classnames = require('classnames');
const Icon = require('@stremio/stremio-icons/dom');
const Image = require('stremio/common/Image');
const styles = require('./styles');
const AddonDetails = ({ className, id, name, version, logo, description, types, transportUrl, official }) => {
const renderLogoFallback = React.useCallback(() => (
), []);
return (
{typeof name === 'string' && name.length > 0 ? name : id}
{
typeof version === 'string' && version.length > 0 ?
v. {version}
:
null
}
{
typeof description === 'string' && description.length > 0 ?
{description}
:
null
}
{
typeof transportUrl === 'string' && transportUrl.length > 0 ?
URL:
{transportUrl}
:
null
}
{
Array.isArray(types) && types.length > 0 ?
Supported types:
{
types.length === 1 ?
types[0]
:
types.slice(0, -1).join(', ') + ' & ' + types[types.length - 1]
}
:
null
}
{
!official ?
Using third-party add-ons will always be subject to your responsibility and the governing law of the jurisdiction you are located.
:
null
}
);
};
AddonDetails.propTypes = {
className: PropTypes.string,
id: PropTypes.string,
name: PropTypes.string,
version: PropTypes.string,
logo: PropTypes.string,
description: PropTypes.string,
types: PropTypes.arrayOf(PropTypes.string),
transportUrl: PropTypes.string,
official: PropTypes.bool,
};
module.exports = AddonDetails;