Dynamic library sources working; Need to expand and test other providers
This commit is contained in:
@ -7,40 +7,41 @@ const LinksSentence = memo(({ items, itemType, className, nolinks }) => {
|
||||
return (
|
||||
<span className={`${className} links-sentence`}>
|
||||
{
|
||||
items.map(({ name, uri, type }, index) => {
|
||||
if (!name) return <span>-</span>;
|
||||
items.map(({ name, uri, type }, index) => {
|
||||
if (!name) return <span>-</span>;
|
||||
|
||||
let separator = null;
|
||||
if (index == items.length - 2) {
|
||||
separator = ' and ';
|
||||
} else if (index < items.length - 2) {
|
||||
separator = ', ';
|
||||
}
|
||||
let separator = null;
|
||||
if (index === items.length - 2) {
|
||||
separator = ' and ';
|
||||
} else if (index < items.length - 2) {
|
||||
separator = ', ';
|
||||
}
|
||||
|
||||
if (!name) {
|
||||
var content = <span>-</span>;
|
||||
} else if (!uri || nolinks) {
|
||||
var content = <span>{name}</span>;
|
||||
} else {
|
||||
var content = (
|
||||
<URILink
|
||||
className="links-sentence__item links-sentence__item--link"
|
||||
uri={uri}
|
||||
type={type || itemType}
|
||||
>
|
||||
{name}
|
||||
</URILink>
|
||||
);
|
||||
}
|
||||
let content = null;
|
||||
if (!name) {
|
||||
content = <span>-</span>;
|
||||
} else if (!uri || nolinks) {
|
||||
content = <span>{name}</span>;
|
||||
} else {
|
||||
content = (
|
||||
<URILink
|
||||
className="links-sentence__item links-sentence__item--link"
|
||||
uri={uri}
|
||||
type={itemType || type}
|
||||
>
|
||||
{name}
|
||||
</URILink>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<span key={`index_${uri}`}>
|
||||
{content}
|
||||
{separator}
|
||||
</span>
|
||||
);
|
||||
})
|
||||
}
|
||||
return (
|
||||
<span key={`index_${uri}`}>
|
||||
{content}
|
||||
{separator}
|
||||
</span>
|
||||
);
|
||||
})
|
||||
}
|
||||
</span>
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user