import Link from "next/link"; import React from "react"; import { useAppSelector, useAppDispatch } from "../lib/hooks"; import { excludedPlugins } from "../lib/plugins"; import { enableAllParsedPlugins, disableAllParsedPlugins, toggleParsedPlugin, } from "../slices/plugins"; import styles from "../styles/ParsedPluginList.module.css"; type Props = { selectedCell?: { x: number; y: number }; }; const ParsedPluginsList: React.FC = ({ selectedCell }) => { const dispatch = useAppDispatch(); const plugins = useAppSelector((state) => selectedCell ? state.plugins.parsedPlugins.filter((plugin) => plugin.parsed?.cells.some( (cell) => cell.x === selectedCell.x && cell.y === selectedCell.y && // TODO: support other worlds cell.world_form_id === 60 && plugin.parsed?.header.masters[0] === "Skyrim.esm" ) ) : state.plugins.parsedPlugins ); const pluginsPending = useAppSelector((state) => state.plugins.pending); return ( <> {plugins.length > 0 &&

Loaded Plugins ({plugins.length})

} {!selectedCell && plugins.length > 0 && (
)}
    0 ? styles["bottom-spacing"] : "" }`} > {plugins.map((plugin) => (
  1. dispatch(toggleParsedPlugin(plugin.filename))} />
  2. ))}
{pluginsPending > 0 && ( Loading {pluginsPending} plugin{pluginsPending === 1 ? "" : "s"} )} ); }; export default ParsedPluginsList;