import variables from 'modules/variables'; import React, { memo } from 'react'; import { MdAutoFixHigh, MdOutlineArrowForward, MdOutlineOpenInNew } from 'react-icons/md'; function Items({ type, items, collection, toggleFunction, collectionFunction, onCollection, filter, }) { return ( <> {(type === 'all' && !onCollection && (filter === null || filter === '')) || (type === 'collections' && !onCollection && (filter === null || filter === '')) ? ( <>
{collection.display_name} {collection.description}
{collection.news === true ? ( {variables.getMessage('modals.main.marketplace.learn_more')} ) : ( )}
) : null}
{items ?.filter( (item) => item.name.toLowerCase().includes(filter.toLowerCase()) || filter === '' || item.author.toLowerCase().includes(filter.toLowerCase()) || item.type.toLowerCase().includes(filter.toLowerCase()), ) .map((item) => (
toggleFunction(item)} key={item.name}> icon
{item.display_name || item.name} {variables.getMessage('modals.main.marketplace.by', { author: item.author })} { type === 'all' && !onCollection ? {variables.getMessage(`modals.main.addons.create.types.${item.type.split('_')[0] === "preset" ? "settings" : item.type.split('_')[0] + 's' }`)} : null }
))}
{type === 'all' && !onCollection ? (
{variables.getMessage('modals.main.marketplace.cant_find')} {variables.getMessage('modals.main.marketplace.knowledgebase_one') + ' '} {variables.getMessage('modals.main.marketplace.knowledgebase_two')} {' ' + variables.getMessage('modals.main.marketplace.knowledgebase_three')}
) : null} ); } export default memo(Items);