import { Grid, Divider, List, ListItem, ListItemText } from "@mui/material"; import { experimentalStyled as styled } from '@mui/material/styles'; import Typography from "@material-ui/core/Typography"; import Paper from "@material-ui/core/Paper"; import Button from '@mui/material/Button'; import Box from '@material-ui/core/Box'; import React, { useState, useEffect } from "react"; import algoliasearch from "algoliasearch"; //import algoliarecommend from "algoliarecommend"; const searchClient = algoliasearch( "JNSS5CFDZZ", "db08e40265e2941b9a7d8f644b6e5240" ); // https://www.algolia.com/doc/api-client/getting-started/install/ /*const algoliarecommend = require('@algolia/recommend'); const client = algoliarecommend( "NSS5CFDZZ", "db08e40265e2941b9a7d8f644b6e5240" );*/ const Item = styled(Paper)(({ theme }) => ({ padding: theme.spacing(2), border: "0.0625rem solid #b2b2b2", borderRadius: "1.5625rem", boxSizing: "content-box", backgroundColor: "transparent", width: "200px", textAlign: 'center', color: theme.palette.text.secondary, marginTop: "20px", marginBottom: "20px", color: "textPrimary" })); const AppExplorer = (props) => { const [algoliaResult, setAlgoliaResult] = useState(""); const runAlgoliaAppSearch = (query) => { const index = searchClient.initIndex("appsearch"); index .search(`${query}`) .then(({ hits }) => { setAlgoliaResult(hits); }) .catch((err) => { console.log(err); }); }; useEffect(() => { runAlgoliaAppSearch("wazuh") }, []) const brandApp = () => { const index = searchClient.initIndex("appsearch"); const replicaIndex = searchClient.initIndex('appsearch'); replicaIndex.setSettings({ customRanking: [ "asc(time_edited)" ] }) .then(({ hits }) => { console.log(hits); }) .catch((err) => { console.log(err); }); }; useEffect(() => { brandApp() }, []) /*const trandingApp = () => { const index = client.getTrendingGlobalItems([ { indexName: "appsearch", threshold: 60 }, ]) .then(({ results }) => { console.log(results); }) .catch(err => { console.log(err); }); }; useEffect(() => { trandingApp(); }, []) */ const SideBar = { minWidth: 250, borderRight: "1px solid rgba(255,255,255,0.3)", left: 0, position: "sticky", minHeight: "90vh", maxHeight: "90vh", overflowX: "hidden", overflowY: "auto", zIndex: 1000, color: "white" }; const contentbar = { padding: "40px", }; const boxdata = { paddingLeft: "30px" } const link = { textDecoration: "none" } const catItems = (