diff --git a/app/page.tsx b/app/page.tsx
index 59f4b41..7efa1b5 100644
--- a/app/page.tsx
+++ b/app/page.tsx
@@ -7,11 +7,23 @@ import { DogmaEngineProvider, EsiCharacterSelection, EsiProvider, EveDataProvide
import { Banner } from "@/components/Banner";
import { LocationHash } from "@/components/LocationHash";
+import { Debug } from "@/components/Debug";
import styles from "./page.module.css";
+declare global {
+ interface Window {
+ esf_debug: () => void;
+ }
+}
+
const Page = () => {
const [selection, setSelection] = React.useState<"hulls" | "hardware">("hulls");
+ const [debug, setDebug] = React.useState(false);
+
+ React.useEffect(() => {
+ window.esf_debug = () => setDebug((prev) => !prev);
+ }, []);
return
@@ -41,6 +53,7 @@ const Page = () => {
+ {debug && }
;
diff --git a/components/Debug/Debug.module.css b/components/Debug/Debug.module.css
new file mode 100644
index 0000000..011e587
--- /dev/null
+++ b/components/Debug/Debug.module.css
@@ -0,0 +1,13 @@
+.debug {
+ background-color: #cdcdcd;
+ padding: 10px;
+}
+
+.header {
+ margin-bottom: 10px;
+ text-align: center;
+}
+
+.debug > select {
+ margin-bottom: 10px;
+}
diff --git a/components/Debug/Debug.tsx b/components/Debug/Debug.tsx
new file mode 100644
index 0000000..93ced71
--- /dev/null
+++ b/components/Debug/Debug.tsx
@@ -0,0 +1,36 @@
+import React from "react";
+
+import styles from "./Debug.module.css";
+import { CalculationDetail, EveDataContext, ShipSnapshotContext } from "@eveshipfit/react";
+
+export const Debug = () => {
+ const eveData = React.useContext(EveDataContext);
+ const snapshot = React.useContext(ShipSnapshotContext);
+
+ const [tab, setTab] = React.useState<"JSON" | "Ship" | "Char" | "Structure" | "Target" | { Item?: number; Charge?: number }>("Ship");
+
+ const items = snapshot?.items?.map((item, index) => { return { item, index }; }).sort((a, b) => a.item.flag - b.item.flag) ?? [];
+
+ return <>
+
+
EVEShip.fit debugger
+
+
+
+ {tab === "JSON" &&
{JSON.stringify(snapshot.currentFit, null, 2)}}
+ {tab !== "JSON" &&
}
+
+ >
+}
diff --git a/components/Debug/index.ts b/components/Debug/index.ts
new file mode 100644
index 0000000..4995a53
--- /dev/null
+++ b/components/Debug/index.ts
@@ -0,0 +1 @@
+export { Debug } from './Debug';