Display parse errors on PluginDetail page

This commit is contained in:
Tyler Hallada 2022-03-18 23:41:06 -04:00
parent daa4d3c039
commit 6527c6d5f7
2 changed files with 10 additions and 1 deletions

View File

@ -11,7 +11,7 @@ import ModList from "./ModList";
import CellList from "./CellList";
import type { CellCoord } from "./ModData";
import PluginData, { Plugin as PluginProps } from "./PluginData";
import styles from "../styles/PluginData.module.css";
import styles from "../styles/PluginDetail.module.css";
import { jsonFetcher } from "../lib/api";
const buildPluginProps = (
@ -79,6 +79,11 @@ const PluginDetail: React.FC<Props> = ({ hash, counts }) => {
<>
<PluginData plugin={buildPluginProps(data, plugin)} counts={counts} />
{data && <ModList mods={data.mods} files={data.files} counts={counts} />}
{plugin?.parseError && (
<div className={styles.error}>
{`Error parsing plugin: ${plugin.parseError}`}
</div>
)}
<CellList
cells={
(plugin?.parsed?.cells.filter(

View File

@ -0,0 +1,4 @@
.error {
color: red;
margin-top: 12px;
}