Armor
@@ -103,5 +118,5 @@ export function WeaponsAndArmor() {
- )
+ );
}
diff --git a/app/root.tsx b/app/root.tsx
index b849a4f..e73ad99 100644
--- a/app/root.tsx
+++ b/app/root.tsx
@@ -38,6 +38,32 @@ export function Layout({ children }: { children: React.ReactNode }) {
+
{children}
diff --git a/app/routes.ts b/app/routes.ts
index 102b402..faea451 100644
--- a/app/routes.ts
+++ b/app/routes.ts
@@ -1,3 +1,6 @@
-import { type RouteConfig, index } from "@react-router/dev/routes";
+import { type RouteConfig, index, route } from "@react-router/dev/routes";
-export default [index("routes/home.tsx")] satisfies RouteConfig;
+export default [
+ index("routes/statsandskills.tsx"),
+ route("gear", "routes/gear.tsx"),
+] satisfies RouteConfig;
diff --git a/app/routes/gear.tsx b/app/routes/gear.tsx
new file mode 100644
index 0000000..792c8ec
--- /dev/null
+++ b/app/routes/gear.tsx
@@ -0,0 +1,135 @@
+import { useState, useEffect } from "react";
+import type { Route } from "./+types/home";
+
+export function meta({}: Route.MetaArgs) {
+ return [
+ { title: "Collateral - Gear" },
+ { name: "description", content: "Gear" },
+ ];
+}
+
+const baseUrl =
+ typeof window !== "undefined"
+ ? window.location.origin
+ : process.env.VITE_VERCEL_URL || "http://localhost:5173"; // Fallback for your server env
+
+const g = await fetch(`${baseUrl}/characters/collateral/gear.json`).then((r) =>
+ r.json(),
+);
+
+type AmmunitionData = {
+ caliber: string;
+ type: string;
+ count: number;
+};
+
+type GearData = {
+ name: string;
+ description: string;
+ count: number;
+ contents: GearData[];
+};
+
+function AmmunitionRow({ ammo }: { ammo: AmunitionData }) {
+ return (
+
+ | {ammo.caliber} |
+ {ammo.type} |
+ {ammo.count}x |
+
+ );
+}
+
+function AmmunitionHeader() {
+ return (
+
+
+ | Caliber |
+ Type |
+ Count |
+
+
+ );
+}
+
+function Ammunition({ ammo }: { ammo: AmmunitionData[] }) {
+ const ammoRows: ReactElement[] = ammo.map((entry, index) => (
+
+ ));
+
+ return (
+
+ );
+}
+
+function InventoryHeader(): ReactElement {
+ return (
+
+
+ | Name |
+ Description |
+ Count |
+
+
+ );
+}
+
+function InventoryWithDepth(name: string, depth: number): string {
+ if (depth === 0) {
+ return name;
+ }
+
+ return "|" + "-".repeat(depth - 1) + "> " + name;
+}
+
+function InventoryRow({
+ gear,
+ depth,
+}: {
+ gear: GearData;
+ depth: number;
+}): ReactElement {
+ const contents = gear.contents
+ ? gear.contents.map((entry, index) => (
+
+ ))
+ : [];
+
+ return (
+ <>
+
+ | {InventoryWithDepth(gear.name, depth)} |
+ {InventoryWithDepth(gear.description, depth)} |
+ {gear.count}x |
+
+ {contents}
+ >
+ );
+}
+
+function Inventory({ gear }: { gear: GearData[] }) {
+ const inventoryRows = gear.map((entry, index) => (
+
+ ));
+
+ return (
+
+ );
+}
+
+export default function Gear() {
+ const [gear] = useState(g);
+
+ return (
+
+
+
+
+ );
+}
diff --git a/app/routes/home.tsx b/app/routes/home.tsx
deleted file mode 100644
index aefd731..0000000
--- a/app/routes/home.tsx
+++ /dev/null
@@ -1,79 +0,0 @@
-import type { Route } from "./+types/home";
-import { Awareness } from "../skills/awareness";
-import { Body } from "../skills/body";
-import { Control } from "../skills/control";
-import { EducationTop, EducationBottom } from "../skills/education"
-import { Fighting } from "../skills/fighting"
-import { Performance } from "../skills/performance"
-import { RangedTop, RangedBottom } from "../skills/ranged"
-import { Social } from "../skills/social"
-import { Technique } from "../skills/technique"
-import { Details } from "../details/details"
-import { Stats } from "../details/stats"
-import { WeaponsAndArmor } from "../details/weaponsandarmor"
-
-export function meta({ }: Route.MetaArgs) {
- return [
- { title: "New React Router App" },
- { name: "description", content: "Welcome to React Router!" },
- ];
-}
-
-function SkillTable() {
- return (
-
-
-
-
-
-
-
-
- );
-
-}
-
diff --git a/app/routes/loadouts.tsx b/app/routes/loadouts.tsx
new file mode 100644
index 0000000..e69de29
diff --git a/app/routes/statsandskills.tsx b/app/routes/statsandskills.tsx
new file mode 100644
index 0000000..2990516
--- /dev/null
+++ b/app/routes/statsandskills.tsx
@@ -0,0 +1,80 @@
+import type { Route } from "./+types/home";
+import { Awareness } from "../skills/awareness";
+import { Body } from "../skills/body";
+import { Control } from "../skills/control";
+import { EducationTop, EducationBottom } from "../skills/education";
+import { Fighting } from "../skills/fighting";
+import { Performance } from "../skills/performance";
+import { RangedTop, RangedBottom } from "../skills/ranged";
+import { Social } from "../skills/social";
+import { Technique } from "../skills/technique";
+import { Details } from "../details/details";
+import { Stats } from "../details/stats";
+import { WeaponsAndArmor } from "../details/weaponsandarmor";
+
+export function meta({}: Route.MetaArgs) {
+ return [
+ { title: "Collateral - Stats and Skills" },
+ { name: "description", content: "Stats and Skills" },
+ ];
+}
+
+function SkillTable() {
+ return (
+