import Link from "next/link"; import React from "react"; import { useAppSelector, useAppDispatch } from "../lib/hooks"; import { excludedPlugins } from "../lib/plugins"; import { togglePlugin } from "../slices/plugins"; import styles from "../styles/PluginList.module.css"; type Props = { selectedCell: { x: number; y: number }; }; const PluginsList: React.FC = ({ selectedCell }) => { const dispatch = useAppDispatch(); const plugins = useAppSelector((state) => selectedCell ? state.plugins.plugins.filter((plugin) => plugin.parsed?.cells.some( (cell) => cell.x === selectedCell.x && cell.y === selectedCell.y ) ) : state.plugins.plugins ); const pluginsPending = useAppSelector((state) => state.plugins.pending); return ( <>
    {plugins.map((plugin) => (
  1. dispatch(togglePlugin(plugin.filename))} /> {/*

    {plugin.parsed && plugin.parsed.header.description}

    */}
  2. ))}
{pluginsPending > 0 && ( Loading {pluginsPending} plugin{pluginsPending === 1 ? "" : "s"} )} ); }; export default PluginsList;