51 lines
1.7 KiB
JavaScript
51 lines
1.7 KiB
JavaScript
/* ═══════════════════════════════════════════════════════════════
|
|
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);
|
|
}
|