import variables from 'modules/variables'; import React, { useState } from 'react'; import { MdAutoFixHigh, MdOutlineArrowForward, MdExpandMore, MdOutlineOpenInNew } from 'react-icons/md'; export default function Items({ type, items, collections = [], toggleFunction, collectionFunction, onCollection, }) { const getMessage = (text) => variables.language.getMessage(variables.languagecode, text); const [count, setCount] = useState(8); const incrementCount = () => { if (count !== items.length && count <= items.length) { if (count + 8 > items.length) { setCount(count + (items.length - count)); } else { setCount(count + 8); } } }; const collection = collections[Math.floor(Math.random() * collections.length)]; return ( <> {(type === 'all' && !onCollection) || (type === 'collections' && !onCollection) ? ( <>