Cotton code
18 lines · 894 B · TypeScriptRaw
/** Where an app stands, from its status in apps.json: its test links while in testing, its store links once released. */import type { App } from "./registry.ts";import { STATUS } from "./copy.ts";import { esc } from "./html.ts";const a_ = (href: string, text: string) => `<a href="${esc(href)}">${text}</a>`;/** The status line: "In testing · TestFlight · Google Play (testing)", or "On the App Store · On Google Play". */export function status(a: App): string {  const parts =    a.status === "released"      ? [a_(a.links.appStore, STATUS.appStore), a_(a.links.googlePlay, STATUS.googlePlay)]      : [`<span>${STATUS.testing}</span>`, a_(a.links.testFlight, STATUS.testFlight), a_(a.links.playTest, STATUS.playTest)];  return `<p class="status">${parts.join(" · ")}</p>`;}/** Not in the stores yet. */export const waiting = (a: App): boolean => a.status !== "released";