import { Link } from "@tanstack/react-router";
import { useEffect, useState } from "react";
import { counts, cover, filtered, sorted, split, SUBMIT, type App, type Catalog, type Sort } from "../apps";
import data from "../showcase.json";
export const catalog = data as Catalog;
/** The day an app joined, as its manifest wrote it. */
export const joined = (app: App) =>
new Date(`${app.publishedAt.slice(0, 10)}T00:00:00Z`).toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric", timeZone: "UTC" });
export const starCount = (n: number) => `${new Intl.NumberFormat("en-US", { notation: "compact" }).format(n)} ${n === 1 ? "star" : "stars"}`;
function Card({ app }: { app: App }) {
return (