Refactor some functions. Try to fetch functions from github api just once when vrct started.(It used to every time plugin tab has opened so easy to reach to the api limit)
18 lines
604 B
JavaScript
18 lines
604 B
JavaScript
import React from "react";
|
|
import { usePlugins } from "@logics_configs";
|
|
|
|
export const PluginHost = () => {
|
|
const { currentLoadedPluginsList } = usePlugins();
|
|
console.log(currentLoadedPluginsList.data);
|
|
|
|
return (
|
|
<div>
|
|
{currentLoadedPluginsList.data
|
|
.filter((plugin) => plugin.location === "main_section")
|
|
.map((plugin, index) => {
|
|
const PluginComponent = plugin.component;
|
|
return PluginComponent ? <PluginComponent key={index} /> : null;
|
|
})}
|
|
</div>
|
|
);
|
|
}; |