import { Link } from "@remix-run/react"; import { Health, totalPopulation, World } from "~/utils/saerro"; import { humanTimeAgo } from "~/utils/strings"; import { worlds } from "~/utils/worlds"; import * as styles from "./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 { FactionBar } from "./faction-bar"; export type IndexWorldProps = { world: World; health?: Health["worlds"][number]; }; export const IndexWorld = ({ world, health }: IndexWorldProps) => { const { platform, location } = worlds[String(world.id || "default")]; const timeSinceLastEvent = humanTimeAgo( new Date().getTime() - new Date(health?.lastEvent || 0).getTime() ); return (
{world.name}
[{location}] [{platform}]{" "}
DETAILS ⇨
{totalPopulation(world.population)}
VS{" "} {world.population.vs}
NC{" "} {world.population.nc}
TR{" "} {world.population.tr}
); };