NGU-Web/src/data/feedbackTypes.ts
Zaldimmar 5274e09571 Clean up code found in the audit
- Replace every em-dash in src and server/src with a colon, comma or hyphen
- Give every relative import its file extension (.jsx imports of .tsx fixed)
- Delete old-historyMock.ts, unused exports, unused CSS utilities, the
  unused @ alias and the fallback option nothing passed
- One copy each of initials, capitalize, byName and the server's marks()
- Move the organization, chapter and event hooks from src/data to src/lib
- Schema sync always throws on a mismatch (strict was never turned off)
- Replace the placeholder README

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 22:02:03 -05:00

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);
}