Display parse errors on PluginDetail page
This commit is contained in:
parent
daa4d3c039
commit
6527c6d5f7
@ -11,7 +11,7 @@ import ModList from "./ModList";
|
|||||||
import CellList from "./CellList";
|
import CellList from "./CellList";
|
||||||
import type { CellCoord } from "./ModData";
|
import type { CellCoord } from "./ModData";
|
||||||
import PluginData, { Plugin as PluginProps } from "./PluginData";
|
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";
|
import { jsonFetcher } from "../lib/api";
|
||||||
|
|
||||||
const buildPluginProps = (
|
const buildPluginProps = (
|
||||||
@ -79,6 +79,11 @@ const PluginDetail: React.FC<Props> = ({ hash, counts }) => {
|
|||||||
<>
|
<>
|
||||||
<PluginData plugin={buildPluginProps(data, plugin)} counts={counts} />
|
<PluginData plugin={buildPluginProps(data, plugin)} counts={counts} />
|
||||||
{data && <ModList mods={data.mods} files={data.files} 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
|
<CellList
|
||||||
cells={
|
cells={
|
||||||
(plugin?.parsed?.cells.filter(
|
(plugin?.parsed?.cells.filter(
|
||||||
|
4
styles/PluginDetail.module.css
Normal file
4
styles/PluginDetail.module.css
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
.error {
|
||||||
|
color: red;
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user