/* eslint-disable @next/next/no-img-element */ import Link from "next/link"; import React from "react"; import { useAppSelector, useAppDispatch } from "../lib/hooks"; import { disableAllFetchedPlugins, enableAllFetchedPlugins, toggleFetchedPlugin, removeFetchedPlugin, } from "../slices/plugins"; import styles from "../styles/FetchedPluginsList.module.css"; type Props = { selectedCell?: { x: number; y: number }; }; const FetchedPluginsList: React.FC = ({ selectedCell }) => { const dispatch = useAppDispatch(); const plugins = useAppSelector((state) => selectedCell ? state.plugins.fetchedPlugins.filter((plugin) => plugin.cells.some( (cell) => cell.x === selectedCell.x && cell.y === selectedCell.y // TODO: support other worlds ) ) : state.plugins.fetchedPlugins ); return ( <> {plugins.length > 0 &&

Added Plugins ({plugins.length})

} {!selectedCell && plugins.length > 0 && (
)}
    0 ? styles["bottom-spacing"] : "" }`} > {plugins.map((plugin) => (
  1. dispatch(toggleFetchedPlugin(plugin.hash))} />
  2. ))}
); }; export default FetchedPluginsList;