Renames every .js module under src/ to .ts (api, useResource, adminSchema, navConfig, adminNav and src/data/*) and points imports, comments and the seed script's module paths at the new names. Their types now come from inference; no .d.ts files and no shape interfaces. tsc stays strict (noImplicitAny off). The errors inference leaves behind get the lightest fix that clears them: `any` on empty state, contexts and list defaults, `: any` on components with optional or spread props, class fields on ApiError, and option shapes on get/useResource. Kept as real types, since they belong to modules that were already TypeScript and later features import them: PageShell's ShellSection and props, useContent's corrected record types (website/email/ instagram are bare strings) and EventListItem, and TimelineRef's orgKind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
51 lines
1.7 KiB
TypeScript
51 lines
1.7 KiB
TypeScript
/* ═══════════════════════════════════════════════════════════════
|
|
FEEDBACK TYPES
|
|
|
|
Used by the public form (to render the tiles) and the admin
|
|
triage view (to label them). The ids must match TYPES in
|
|
server/src/routes/feedback.js — that list stays separate because
|
|
the server isn't in this workspace, and it's the thing that
|
|
decides what's storable.
|
|
|
|
'general' isn't offered anywhere; it's the server's fallback for
|
|
a type it doesn't recognise, so old rows still read sensibly.
|
|
═══════════════════════════════════════════════════════════════ */
|
|
|
|
export const FEEDBACK_TYPES = [
|
|
{
|
|
id: "broken",
|
|
label: "Something's broken",
|
|
hint: "A link, image, or button that doesn't work",
|
|
},
|
|
{
|
|
id: "confusing",
|
|
label: "Hard to use",
|
|
hint: "Something you couldn't find or follow",
|
|
},
|
|
{
|
|
id: "outdated",
|
|
label: "Wrong or missing info",
|
|
hint: "Old dates, typos, an event that isn't listed",
|
|
},
|
|
{
|
|
id: "request",
|
|
label: "Feature request",
|
|
hint: "Something you'd like the site to do",
|
|
},
|
|
{
|
|
id: "praise",
|
|
label: "Kind words",
|
|
hint: "Tell us what's working well",
|
|
},
|
|
{
|
|
id: "other",
|
|
label: "Something else",
|
|
hint: "Anything that doesn't fit the boxes above",
|
|
},
|
|
];
|
|
|
|
const BY_ID = new Map(FEEDBACK_TYPES.map((t) => [t.id, t.label]));
|
|
|
|
export function feedbackTypeLabel(id) {
|
|
return BY_ID.get(id) ?? (id === "general" ? "Unsorted" : id);
|
|
}
|