2021-10-12 21:18:47 +00:00
|
|
|
import variables from 'modules/variables';
|
2022-04-27 15:30:54 +00:00
|
|
|
import { MdAutoFixHigh } from 'react-icons/md';
|
2021-10-12 21:18:47 +00:00
|
|
|
|
2022-04-08 13:48:36 +00:00
|
|
|
export default function Items({
|
|
|
|
type,
|
|
|
|
items,
|
|
|
|
collections,
|
|
|
|
toggleFunction,
|
|
|
|
collectionFunction,
|
|
|
|
onCollection,
|
|
|
|
}) {
|
2022-06-04 10:58:01 +00:00
|
|
|
const getMessage = (text) => variables.language.getMessage(variables.languagecode, text);
|
|
|
|
|
2021-03-17 13:01:53 +00:00
|
|
|
return (
|
2022-04-08 13:48:36 +00:00
|
|
|
<>
|
|
|
|
{type === 'all' && !onCollection ? (
|
|
|
|
<>
|
2022-06-05 14:56:29 +00:00
|
|
|
{collections.map((collection, index) => (
|
|
|
|
<div className="collection" key={index}>
|
2022-04-08 13:48:36 +00:00
|
|
|
<div className="content">
|
|
|
|
<span className="title">{collection.display_name}</span>
|
|
|
|
<span className="subtitle">{collection.description}</span>
|
|
|
|
<button onClick={() => collectionFunction(collection.name)}>
|
2022-06-04 10:58:01 +00:00
|
|
|
{getMessage('modals.main.marketplace.explore_collection')}
|
2022-04-08 13:48:36 +00:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
))}
|
|
|
|
</>
|
|
|
|
) : null}
|
|
|
|
<div className="items">
|
|
|
|
{items.map((item) => (
|
|
|
|
<div className="item" onClick={() => toggleFunction(item)} key={item.name}>
|
|
|
|
<img
|
|
|
|
alt="icon"
|
|
|
|
draggable="false"
|
|
|
|
src={variables.constants.DDG_IMAGE_PROXY + item.icon_url}
|
|
|
|
/>
|
|
|
|
<div className="card-details">
|
|
|
|
<span className="card-title">{item.display_name || item.name}</span>
|
|
|
|
<span className="card-subtitle">{item.author}</span>
|
|
|
|
</div>
|
2021-04-03 12:32:00 +00:00
|
|
|
</div>
|
2022-04-08 13:48:36 +00:00
|
|
|
))}
|
|
|
|
</div>
|
2022-04-27 15:30:54 +00:00
|
|
|
{type === 'all' && !onCollection ? (
|
2022-04-24 20:12:49 +00:00
|
|
|
<div className="createYourOwn">
|
|
|
|
<MdAutoFixHigh />
|
2022-06-04 10:58:01 +00:00
|
|
|
<span className="title">{getMessage('modals.main.marketplace.cant_find')}</span>
|
2022-04-24 20:12:49 +00:00
|
|
|
<span className="subtitle">
|
2022-06-04 10:58:01 +00:00
|
|
|
{getMessage('modals.main.marketplace.knowledgebase_one')}{' '}
|
2022-07-28 12:12:13 +00:00
|
|
|
<a
|
|
|
|
className="link"
|
|
|
|
target="_blank"
|
|
|
|
href={variables.constants.KNOWLEDGEBASE}
|
|
|
|
rel="noreferrer"
|
|
|
|
>
|
2022-06-04 10:58:01 +00:00
|
|
|
{getMessage('modals.main.marketplace.knowledgebase_two')}
|
2022-06-03 20:52:37 +00:00
|
|
|
</a>{' '}
|
2022-06-04 10:58:01 +00:00
|
|
|
{getMessage('modals.main.marketplace.knowledgebase_three')}
|
2022-04-24 20:12:49 +00:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
) : null}
|
2022-04-08 13:48:36 +00:00
|
|
|
</>
|
2021-03-17 13:01:53 +00:00
|
|
|
);
|
|
|
|
}
|