โ– humdrum codex / soft
682 B raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import type { SourceModule } from "../registry";
import {
  LinksConfig,
  LinksPayload,
  type LinksConfig as Config,
  type LinksPayload as Payload,
} from "@/lib/schemas/sources/links";

// A static list of links (other web apps, bookmarks). No network โ€” the payload
// is just the configured list, so the card renders from the cached snapshot.
export const linksModule: SourceModule<Config, Payload> = {
  kind: "links",
  label: "Links",
  keyless: true,
  defaultRefreshSeconds: 86_400,
  configSchema: LinksConfig,
  payloadSchema: LinksPayload,

  isConfigured: (config) => config.links.length > 0,

  async fetch({ config }) {
    return { links: config.links };
  },
};