import type { LoaderArgs, V2_MetaFunction } from "@remix-run/cloudflare";
import { json } from "@remix-run/cloudflare";
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 } from "~/utils/sorting";
type LoaderData = {
saerro: WorldResponse;
metagame: MetagameWorld;
id: string;
};
export async function loader({ params }: LoaderArgs) {
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: V2_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}
Continents
{world.zones.all.map((zone) => (
{zoneInfo.name}
{allClasses.map((cls, idx) => (
{totalPopulation(zone.vehicles as any)} vehicles...