import { content } from "@deadhead/content";
import { realToGame } from "@deadhead/sim";
import { useClock } from "../clock/clock";
import { formatGameTime } from "../clock/GameClock";
import { Countdown } from "../components/Countdown";
import { GoalsCard } from "../components/GoalsCard";
import { LoanCard } from "../components/LoanCard";
import { formatCredits, locationName } from "../format";
import { useLoadedPlayer } from "../state/actions";
export function HQ() {
const state = useLoadedPlayer();
const now = useClock((s) => s.now);
const idle = state.ships.filter((s) => s.status === "idle").length;
const flying = state.ships.filter((s) => s.status === "in-flight").length;
const runsBeforeDeal = content.config.tutorialRunsBeforeDeal;
const next = [...state.activeDispatches].sort((a, b) => a.arrivalAt - b.arrivalAt)[0];
return (
{locationName(next.originId)} → {locationName(next.destinationId)} in{" "}
Nothing in flight. No ships yet — buy one in the Market.
Company runs: {Math.min(state.tutorial.runsCompleted, runsBeforeDeal)} of{" "}
{runsBeforeDeal}
Keep flying — the old man has an offer for you.
HQ
Next arrival
{next ? (
Flying for Halvorsen Lunar Freight