import type { MetaFunction } from "@remix-run/node";
import { json } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { Footer } from "../components/footer";
import type { MetagameWorld } from "../utils/metagame";
import { fetchSingleMetagameWorld } from "../utils/metagame";
import type { WorldResponse, Zone } from "../utils/saerro";
import {
allClasses,
allVehicles,
totalPopulation,
worldQuery,
} from "../utils/saerro";
import {
pascalCaseToTitleCase,
toTitleCase,
worlds,
zones,
} from "../utils/strings";
import * as styles from "../components/world.css";
import { c } from "../utils/classes";
import { FactionBar } from "../components/faction-bar";
import { popImage } from "../components/index-world.css";
import vsLogo from "../images/vs-100.png";
import ncLogo from "../images/nc-100.png";
import trLogo from "../images/tr-100.png";
import { FactionPie } from "../components/faction-pie";
import { AlertTimer } from "../components/alert-timer";
import { contPrioritySort, zonePopulationSort } from "../utils/sorting";
import { WorldZoneContainer } from "../components/world-zone-container";
type LoaderData = {
saerro: WorldResponse;
metagame: MetagameWorld;
id: string;
};
export async function loader({ params }) {
const [saerro, metagame] = await Promise.all([
worldQuery(params.id as string),
fetchSingleMetagameWorld(params.id as string),
]);
return json({ saerro, metagame, id: params.id } as LoaderData);
}
export const meta: MetaFunction
{totalPopulation(zone.population)} players ({zone.population.vs} VS,{" "}
{zone.population.nc} NC, {zone.population.tr} TR)
{" "}
{world.population.vs}
{" "}
{world.population.nc}
{" "}
{world.population.tr}
WARZONES
{zoneInfo.name.toUpperCase()}
{allClasses.map((cls, idx) => (
{totalPopulation(zone.vehicles as any)} vehicles...