@eifi1/ui-kit 0.25.1 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/README.md +16 -5
  2. package/dist/chart.d.ts +13 -9
  3. package/dist/components/account-chips.d.ts +1 -1
  4. package/dist/components/amount-input.d.ts +13 -9
  5. package/dist/components/button-group.d.ts +13 -9
  6. package/dist/components/calculator.d.ts +13 -9
  7. package/dist/components/confirm-dialog.d.ts +13 -9
  8. package/dist/components/copy-button.d.ts +10 -6
  9. package/dist/components/danger-confirm.d.ts +13 -9
  10. package/dist/components/data-table-cells.d.ts +1 -1
  11. package/dist/components/data-table-filter-popover.d.ts +1 -1
  12. package/dist/components/data-table-filters.d.ts +1 -1
  13. package/dist/components/data-table-labels.d.ts +1 -1
  14. package/dist/components/data-table-pagination.d.ts +1 -1
  15. package/dist/components/data-table.d.ts +1 -1
  16. package/dist/components/data-table.js +3 -2
  17. package/dist/components/data-table.js.map +1 -1
  18. package/dist/components/facing-pair.d.ts +13 -9
  19. package/dist/components/file-button.d.ts +13 -9
  20. package/dist/components/file-dropzone.d.ts +13 -9
  21. package/dist/components/form-actions.d.ts +13 -9
  22. package/dist/components/iban-input.d.ts +13 -9
  23. package/dist/components/language-select.d.ts +13 -9
  24. package/dist/components/money-field.d.ts +13 -9
  25. package/dist/components/number-field.d.ts +13 -9
  26. package/dist/components/number-input.d.ts +13 -9
  27. package/dist/components/numpad-sheet.d.ts +13 -9
  28. package/dist/components/phone-input.d.ts +13 -9
  29. package/dist/components/series-chart.d.ts +13 -9
  30. package/dist/components/settings-fields.d.ts +13 -9
  31. package/dist/components/share-card.d.ts +13 -9
  32. package/dist/components/swipeable-row.d.ts +5 -1
  33. package/dist/components/swipeable-row.js.map +1 -1
  34. package/dist/components/text-link.d.ts +13 -9
  35. package/dist/components/time-input.d.ts +13 -9
  36. package/dist/components/translation-review-labels.d.ts +4 -0
  37. package/dist/components/translation-review-labels.js +2 -1
  38. package/dist/components/translation-review-labels.js.map +1 -1
  39. package/dist/components/translation-review.d.ts +27 -3
  40. package/dist/components/translation-review.js +50 -21
  41. package/dist/components/translation-review.js.map +1 -1
  42. package/dist/components/ui.d.ts +10 -6
  43. package/dist/components/use-table-state.d.ts +1 -1
  44. package/dist/{data-table-labels-Cdn1QS2k.d.ts → data-table-labels-DUELeXpa.d.ts} +5 -0
  45. package/dist/data-table.d.ts +1 -1
  46. package/dist/feedback/feedback-attachment.d.ts +13 -9
  47. package/dist/feedback/feedback-attachment.js +3 -3
  48. package/dist/feedback/feedback-attachment.js.map +1 -1
  49. package/dist/feedback/feedback-capture.d.ts +71 -0
  50. package/dist/feedback/feedback-capture.js +194 -0
  51. package/dist/feedback/feedback-capture.js.map +1 -0
  52. package/dist/feedback/feedback-context.d.ts +71 -0
  53. package/dist/feedback/feedback-context.js +96 -0
  54. package/dist/feedback/feedback-context.js.map +1 -0
  55. package/dist/feedback/feedback-crash.d.ts +276 -0
  56. package/dist/feedback/feedback-crash.js +225 -0
  57. package/dist/feedback/feedback-crash.js.map +1 -0
  58. package/dist/feedback/feedback-dialog.d.ts +13 -9
  59. package/dist/feedback/feedback-dialog.js +5 -3
  60. package/dist/feedback/feedback-dialog.js.map +1 -1
  61. package/dist/feedback/feedback-inbox.d.ts +13 -9
  62. package/dist/feedback/feedback-inbox.js +89 -49
  63. package/dist/feedback/feedback-inbox.js.map +1 -1
  64. package/dist/feedback/feedback-labels.d.ts +71 -0
  65. package/dist/feedback/feedback-labels.js +48 -0
  66. package/dist/feedback/feedback-labels.js.map +1 -0
  67. package/dist/feedback/feedback-menu.d.ts +71 -0
  68. package/dist/feedback/feedback-menu.js +61 -0
  69. package/dist/feedback/feedback-menu.js.map +1 -0
  70. package/dist/feedback/feedback-record.d.ts +71 -0
  71. package/dist/feedback/feedback-record.js +104 -0
  72. package/dist/feedback/feedback-record.js.map +1 -0
  73. package/dist/feedback/feedback-row-detail.d.ts +71 -0
  74. package/dist/feedback/feedback-row-detail.js +437 -0
  75. package/dist/feedback/feedback-row-detail.js.map +1 -0
  76. package/dist/feedback/feedback-status-undo.d.ts +71 -0
  77. package/dist/feedback/feedback-status-undo.js +40 -0
  78. package/dist/feedback/feedback-status-undo.js.map +1 -0
  79. package/dist/feedback/feedback-submit.d.ts +182 -0
  80. package/dist/feedback/feedback-submit.js +101 -0
  81. package/dist/feedback/feedback-submit.js.map +1 -0
  82. package/dist/feedback/feedback-swipe.d.ts +152 -0
  83. package/dist/feedback/feedback-swipe.js +73 -0
  84. package/dist/feedback/feedback-swipe.js.map +1 -0
  85. package/dist/feedback/feedback-table.d.ts +71 -0
  86. package/dist/feedback/feedback-table.js +357 -0
  87. package/dist/feedback/feedback-table.js.map +1 -0
  88. package/dist/feedback/feedback-thread.d.ts +13 -9
  89. package/dist/feedback.d.ts +17 -9
  90. package/dist/feedback.js +11 -0
  91. package/dist/feedback.js.map +1 -1
  92. package/dist/hooks/use-file-drop.d.ts +13 -9
  93. package/dist/i18n/defaults.d.ts +13 -9
  94. package/dist/i18n/defaults.js +16 -0
  95. package/dist/i18n/defaults.js.map +1 -1
  96. package/dist/i18n/german.d.ts +13 -9
  97. package/dist/i18n/german.js +92 -5
  98. package/dist/i18n/german.js.map +1 -1
  99. package/dist/i18n/kit-labels.d.ts +7 -3
  100. package/dist/i18n/kit-labels.js.map +1 -1
  101. package/dist/i18n/languages.d.ts +13 -9
  102. package/dist/i18n/locales/de-CH.d.ts +13 -9
  103. package/dist/i18n/locales/en.d.ts +13 -9
  104. package/dist/i18n/locales/en.js +11 -1
  105. package/dist/i18n/locales/en.js.map +1 -1
  106. package/dist/i18n/locales/es.d.ts +13 -9
  107. package/dist/i18n/locales/es.js +90 -5
  108. package/dist/i18n/locales/es.js.map +1 -1
  109. package/dist/i18n/locales/fr.d.ts +13 -9
  110. package/dist/i18n/locales/fr.js +90 -5
  111. package/dist/i18n/locales/fr.js.map +1 -1
  112. package/dist/i18n/locales/hu.d.ts +13 -9
  113. package/dist/i18n/locales/hu.js +91 -5
  114. package/dist/i18n/locales/hu.js.map +1 -1
  115. package/dist/i18n/locales/it.d.ts +13 -9
  116. package/dist/i18n/locales/it.js +90 -5
  117. package/dist/i18n/locales/it.js.map +1 -1
  118. package/dist/i18n/locales/zh.d.ts +13 -9
  119. package/dist/i18n/locales/zh.js +90 -5
  120. package/dist/i18n/locales/zh.js.map +1 -1
  121. package/dist/i18n/review.d.ts +16 -11
  122. package/dist/i18n/review.js +12 -0
  123. package/dist/i18n/review.js.map +1 -1
  124. package/dist/i18n/swiss.js +3 -1
  125. package/dist/i18n/swiss.js.map +1 -1
  126. package/dist/index.d.ts +7 -3
  127. package/dist/index.js +18 -1
  128. package/dist/index.js.map +1 -1
  129. package/dist/{feedback-BXKH-ToU.d.ts → kit-labels-DQg82eHB.d.ts} +1275 -25
  130. package/dist/lib/translation-review.d.ts +76 -1
  131. package/dist/lib/translation-review.js +30 -0
  132. package/dist/lib/translation-review.js.map +1 -1
  133. package/dist/rhf/fields.d.ts +13 -9
  134. package/dist/rhf/form.d.ts +13 -9
  135. package/dist/rhf.d.ts +13 -9
  136. package/dist/shell/app-shell.d.ts +13 -9
  137. package/dist/shell/top-bar-brand.d.ts +13 -9
  138. package/dist/shell.d.ts +11 -11
  139. package/dist/wizard/stepper-nav.d.ts +13 -9
  140. package/dist/wizard.d.ts +13 -9
  141. package/package.json +6 -1
  142. package/src/components/data-table.tsx +14 -2
  143. package/src/components/swipeable-row.tsx +5 -1
  144. package/src/components/translation-review-labels.ts +5 -0
  145. package/src/components/translation-review.tsx +102 -35
  146. package/src/feedback/feedback-attachment.tsx +19 -3
  147. package/src/feedback/feedback-capture.ts +285 -0
  148. package/src/feedback/feedback-context.tsx +217 -0
  149. package/src/feedback/feedback-crash.ts +547 -0
  150. package/src/feedback/feedback-dialog.tsx +29 -6
  151. package/src/feedback/feedback-inbox.tsx +131 -27
  152. package/src/feedback/feedback-labels.ts +127 -0
  153. package/src/feedback/feedback-menu.tsx +132 -0
  154. package/src/feedback/feedback-record.ts +345 -0
  155. package/src/feedback/feedback-row-detail.tsx +825 -0
  156. package/src/feedback/feedback-status-undo.ts +111 -0
  157. package/src/feedback/feedback-submit.tsx +224 -0
  158. package/src/feedback/feedback-swipe.tsx +170 -0
  159. package/src/feedback/feedback-table.tsx +757 -0
  160. package/src/feedback.ts +13 -0
  161. package/src/i18n/defaults.ts +16 -0
  162. package/src/i18n/german.ts +99 -5
  163. package/src/i18n/kit-labels.tsx +20 -0
  164. package/src/i18n/locales/en.ts +16 -1
  165. package/src/i18n/locales/es.ts +97 -5
  166. package/src/i18n/locales/fr.ts +96 -5
  167. package/src/i18n/locales/hu.ts +95 -5
  168. package/src/i18n/locales/it.ts +98 -5
  169. package/src/i18n/locales/zh.ts +91 -5
  170. package/src/i18n/review.ts +15 -2
  171. package/src/i18n/swiss.ts +5 -1
  172. package/src/index.ts +19 -0
  173. package/src/lib/translation-review.ts +109 -0
  174. package/tokens.css +8 -0
@@ -0,0 +1,757 @@
1
+ import { useMemo } from "react";
2
+ import type { MouseEvent, ReactElement, ReactNode } from "react";
3
+ import { ExternalLink } from "lucide-react";
4
+ import { cn } from "../lib/cn";
5
+ import { toLocalIso } from "../lib/dates";
6
+ import { EMPTY_FORMATTED_VALUE, formatDate, toDate } from "../lib/format";
7
+ import { useKitDateFormatter, useKitLabels, useKitLink, useKitLocale } from "../i18n/kit-labels";
8
+ import type { KitLinkProps } from "../i18n/kit-labels";
9
+ import { Chip } from "../components/chip";
10
+ import { FloatingAction, FloatingActionGroup } from "../components/floating-panel";
11
+ import type { FloatingCorner } from "../components/floating-panel";
12
+ import { pickLinkRenderer } from "../components/text-link";
13
+ import type { DataTableColumn } from "../components/data-table";
14
+ import {
15
+ FEEDBACK_CATEGORY_ORDER,
16
+ FEEDBACK_STATUS_META,
17
+ FEEDBACK_STATUS_ORDER,
18
+ FeedbackCategoryBadge,
19
+ FeedbackStatusBadge,
20
+ FeedbackStatusTransitions,
21
+ feedbackCategoryRank,
22
+ visibleFeedbackStatuses,
23
+ type FeedbackStatus,
24
+ } from "./feedback-inbox";
25
+ import {
26
+ useFeedbackCategoryLabels,
27
+ useFeedbackStatusLabels,
28
+ type FeedbackCategoryLabels,
29
+ type FeedbackStatusLabels,
30
+ } from "./feedback-labels";
31
+ import { FEEDBACK_AWAITING_STATUSES, reworkCount, type FeedbackContext, type FeedbackRecord } from "./feedback-record";
32
+ import type { FeedbackStatusChange } from "./feedback-status-undo";
33
+ import { feedbackPageHref, feedbackPagePath } from "./feedback-row-detail";
34
+
35
+ /**
36
+ * The two feedback pages' TABLE — `/feedback` (the admin inbox) and `/my-feedback` (the
37
+ * user's own) — as the kit's parts: §4.3 of the feedback contract
38
+ * (docs/feedback-harmonization.md), lifted from keksdose
39
+ * `frontend/src/features/feedback/feedback-page.tsx` (columns :711–963, the phone card
40
+ * :1038–1065, the awaiting toggle :689–709 and :1086–1101).
41
+ *
42
+ * Until 0.27 each app wrote this table itself, and the three had drifted exactly where a
43
+ * table drifts: kastlan's showed five statuses and no environment, Kurvenschmiede's one
44
+ * page served both audiences, and keksdose's — the canon, argued over a year of feedback
45
+ * items — had a latent bug of its own: its subject cell carries the environment and
46
+ * rework chips "so a second attempt is marked on every surface at once" (:760), but the
47
+ * phone card is a `mobileCard`, and `DataTable` never renders the `mobilePrimary` cell
48
+ * when `mobileCard` is set (data-table.tsx, `cardInner`). Its phone cards showed neither
49
+ * chip. {@link FeedbackMobileCard} draws both itself, from the same
50
+ * {@link FeedbackSubject} the column uses, so the two surfaces cannot part again.
51
+ *
52
+ * What stays the app's: the rows (its API client), who is an admin, the routes and the
53
+ * `/feedback` → `/my-feedback` redirect, the `?row=` deep link and the row detail. What
54
+ * is here: the nine columns ({@link feedbackColumns} / {@link useFeedbackColumns}), the
55
+ * phone card and its day headers ({@link FeedbackMobileCard},
56
+ * {@link feedbackMobileGroupBy}), the phone's "Only what is waiting for you" toggle
57
+ * ({@link FeedbackAwaitingToggle}), the empty state ({@link FeedbackEmptyState}) and the
58
+ * `feedbackPage` words. The swipes are `feedbackSwipePlan` (feedback-swipe.tsx), passed
59
+ * by the app because whether the page may write is the app's call.
60
+ */
61
+
62
+ /* ── Labels ─────────────────────────────────────────────────────────────────── */
63
+
64
+ /**
65
+ * `feedbackPage` — the words of the two feedback pages (§4.3). The English is keksdose's
66
+ * `en.json` (`feedback.*`, `common.none`); the de-CH canon is noted on each key (keksdose
67
+ * `de-CH.json`, ss never ß).
68
+ */
69
+ export interface FeedbackPageLabels {
70
+ /** The admin inbox's page title, `/feedback`. de-CH: "Feedback" */
71
+ title: string;
72
+ /** The user's own list, `/my-feedback`. de-CH: "Mein Feedback" */
73
+ myTitle: string;
74
+ /** Column 1, the id. de-CH: "#" */
75
+ columnId: string;
76
+ /** Column 2, when it was filed. de-CH: "Datum" */
77
+ columnDate: string;
78
+ /** Column 3. de-CH: "Kategorie" */
79
+ columnCategory: string;
80
+ /** Column 4, the title with its chips. de-CH: "Betreff" */
81
+ columnSubject: string;
82
+ /** Column 5, who filed it. de-CH: "Nutzer" */
83
+ columnUser: string;
84
+ /** Column 6. de-CH: "E-Mail" */
85
+ columnEmail: string;
86
+ /** Column 7, the page it was filed from. de-CH: "URL" */
87
+ columnUrl: string;
88
+ /** Column 8. de-CH: "Status" */
89
+ columnStatus: string;
90
+ /** Column 9, when it was settled. de-CH: "Erledigt am" */
91
+ columnResolved: string;
92
+ /** What the URL cell's link does, said before the path to a screen reader.
93
+ * de-CH: "Seite öffnen" */
94
+ openPage: string;
95
+ /** The table with nothing to show, on both pages (§7.13) — keksdose's `common.none`.
96
+ * de-CH: "Keine" */
97
+ empty: string;
98
+ /** The submitter of a report whose account was erased (`user_id: null`, keksdose live
99
+ * #275). de-CH: "<gelöschter Nutzer>" */
100
+ deletedUser: string;
101
+ /** The submitter when neither a name nor an email is known — `id` is `user_id`.
102
+ * de-CH: "Nutzer #{{id}}" */
103
+ userFallback: (id: number) => string;
104
+ /** The chip for a report filed from a copy of the app that is not production —
105
+ * `environment` is `context.environment` as filed ("dev", "local", or the app's own
106
+ * word). Upper-cased like the top bar's environment badge, so the marker the tester saw
107
+ * is the marker triage sees. Guarded: a context is untyped JSON, so a value that is no
108
+ * string (an app calling it with `context.environment` as stored) is printed, never
109
+ * thrown on. de-CH: the same. */
110
+ environment: (environment: string) => string;
111
+ /** The chip for a report sent back for rework — `count` ≥ 1 is how many times
112
+ * (`reworkCount`, keksdose live #331). de-CH: "Nacharbeit" / "Nacharbeit ×{{count}}" */
113
+ reworkChip: (count: number) => string;
114
+ /** The phone toggle narrowing the inbox to IN_EVALUATION + NEEDS_LIVE_TEST.
115
+ * de-CH: "Nur was auf Sie wartet" */
116
+ awaitingFilter: string;
117
+ /** The name of the phone's floating group that holds it. de-CH: "Feedback-Aktionen" */
118
+ phoneActions: string;
119
+ }
120
+
121
+ export const DEFAULT_FEEDBACK_PAGE_LABELS: FeedbackPageLabels = {
122
+ title: "Feedback",
123
+ myTitle: "My feedback",
124
+ columnId: "#",
125
+ columnDate: "Date",
126
+ columnCategory: "Category",
127
+ columnSubject: "Subject",
128
+ columnUser: "User",
129
+ columnEmail: "Email",
130
+ columnUrl: "URL",
131
+ columnStatus: "Status",
132
+ columnResolved: "Resolved",
133
+ openPage: "Open page",
134
+ empty: "None",
135
+ deletedUser: "<deleted user>",
136
+ userFallback: (id) => `user #${id}`,
137
+ environment: (environment) => String(environment ?? "").toUpperCase(),
138
+ reworkChip: (count) => (count === 1 ? "Rework" : `Rework ×${count}`),
139
+ awaitingFilter: "Only what is waiting for you",
140
+ phoneActions: "Feedback actions",
141
+ };
142
+
143
+ /** `feedbackPage` resolved: English, then `<UiKitProvider labels>`, then `labels`. The
144
+ * page's title comes from here too: `mine ? labels.myTitle : labels.title`. */
145
+ export function useFeedbackPageLabels(labels?: Partial<FeedbackPageLabels>): FeedbackPageLabels {
146
+ return useKitLabels("feedbackPage", DEFAULT_FEEDBACK_PAGE_LABELS, labels);
147
+ }
148
+
149
+ /* ── Reading a row ──────────────────────────────────────────────────────────── */
150
+
151
+ /** What the table reads off a report — {@link FeedbackRecord}'s fields, so an app's own
152
+ * row type with more of them passes as it is. */
153
+ export type FeedbackTableRow = Pick<
154
+ FeedbackRecord,
155
+ "id" | "user_id" | "user_email" | "title" | "body" | "category" | "status" | "context" | "resolved_at" | "created_at"
156
+ >;
157
+
158
+ /** A context value as a trimmed string, or `""` — every key is optional on read (§3.2)
159
+ * and an app's own context type may say `unknown`. */
160
+ function text(value: unknown): string {
161
+ return typeof value === "string" ? value.trim() : "";
162
+ }
163
+
164
+ /**
165
+ * The environment a report was filed from when it is NOT production, as filed — or
166
+ * `null` (keksdose `environmentLabel`, :142). Production is silent, as the top bar's
167
+ * badge is: the marker earns attention by being rare. A missing value is production too —
168
+ * every row filed before a test copy existed, and crash rows filed before the crash
169
+ * payload carried `environment` (§3.2, §3.6). An unknown value is shown rather than swallowed: an environment
170
+ * nobody recognises is exactly when triage needs to see one.
171
+ */
172
+ export function feedbackEnvironment(context: FeedbackContext | null | undefined): string | null {
173
+ const env = text(context?.environment);
174
+ return !env || env.toLowerCase() === "prod" ? null : env;
175
+ }
176
+
177
+ /**
178
+ * Who filed a report, as one string (keksdose `submitterLabel`, :163): the display name,
179
+ * else the email, else `userFallback(user_id)`. An erased account (`user_id: null`) is
180
+ * `deletedUser` FIRST, ahead of the context: the server scrubs the name with the account,
181
+ * but a row that somehow kept one must still not go on naming somebody who asked to be
182
+ * forgotten. The joined `user_email` (admin list) is preferred to the context snapshot.
183
+ */
184
+ export function feedbackSubmitter(
185
+ row: Pick<FeedbackRecord, "user_id" | "user_email" | "context">,
186
+ labels: Pick<FeedbackPageLabels, "deletedUser" | "userFallback">,
187
+ ): string {
188
+ if (row.user_id == null) return labels.deletedUser;
189
+ return (
190
+ text(row.context?.user_display_name) ||
191
+ text(row.user_email) ||
192
+ text(row.context?.user_email) ||
193
+ labels.userFallback(row.user_id)
194
+ );
195
+ }
196
+
197
+ /**
198
+ * The submitter's email (keksdose `submitterEmail`, :175): the joined `user_email` —
199
+ * authoritative, the display name is self-chosen (feedback #108) — else the context
200
+ * snapshot, which is what `/my-feedback` has (`GET /feedback/my` sends no join). `""`
201
+ * for an erased account, for the reason {@link feedbackSubmitter} gives.
202
+ */
203
+ export function feedbackSubmitterEmail(row: Pick<FeedbackRecord, "user_id" | "user_email" | "context">): string {
204
+ if (row.user_id == null) return "";
205
+ return text(row.user_email) || text(row.context?.user_email);
206
+ }
207
+
208
+ /** Whether a status is one the phone's awaiting toggle keeps — `FEEDBACK_AWAITING_STATUSES`,
209
+ * the two that wait on the person triaging. `rows.filter((r) => isFeedbackAwaiting(r.status))`. */
210
+ export function isFeedbackAwaiting(status: FeedbackStatus): boolean {
211
+ return FEEDBACK_AWAITING_STATUSES.includes(status);
212
+ }
213
+
214
+ /* ── Dates ──────────────────────────────────────────────────────────────────── */
215
+
216
+ /**
217
+ * How the pages write a date: an ISO timestamp in, one string out. keksdose passes its
218
+ * `useDateCell()` (the app's date-format preference, weekday and all — dev#546), which
219
+ * fits as it is.
220
+ *
221
+ * ONE function for the date column, the resolved column, the phone card and the phone's
222
+ * day headers, so the four cannot disagree (keksdose dev#546 round 3: the header is a
223
+ * string and must say what the card says).
224
+ */
225
+ export type FeedbackRenderDate = (iso: string) => string;
226
+
227
+ /** The kit's own date, weekday included: "Sun, 4 Oct 2026" / "So., 4. Okt. 2026". A date
228
+ * in a column carries its weekday (keksdose's rule, date-cell.tsx). */
229
+ const FEEDBACK_DATE_STYLE: Intl.DateTimeFormatOptions = {
230
+ weekday: "short",
231
+ day: "numeric",
232
+ month: "short",
233
+ year: "numeric",
234
+ };
235
+
236
+ /**
237
+ * `renderDate` when the app gave one, else the kit's: the `<UiKitProvider formatDate>`
238
+ * when the app set one (called with the LOCAL calendar day and `weekday: true`, as
239
+ * `DateMark` calls it), else `Intl` in the provider's locale with the weekday. An
240
+ * unparseable value is passed through rather than hidden.
241
+ */
242
+ export function useFeedbackRenderDate(renderDate?: FeedbackRenderDate, locale?: string): FeedbackRenderDate {
243
+ const kitLocale = useKitLocale(locale);
244
+ const fromProvider = useKitDateFormatter();
245
+ return useMemo<FeedbackRenderDate>(() => {
246
+ if (renderDate) return renderDate;
247
+ return (iso) => {
248
+ const date = toDate(iso);
249
+ if (!date) return iso || EMPTY_FORMATTED_VALUE;
250
+ const own = fromProvider
251
+ ? fromProvider(toLocalIso(date), { unit: "day", source: "dateMark", locale: kitLocale, weekday: true })
252
+ : "";
253
+ return own || formatDate(date, FEEDBACK_DATE_STYLE, { locale: kitLocale });
254
+ };
255
+ }, [renderDate, fromProvider, kitLocale]);
256
+ }
257
+
258
+ /** A date in a cell: `<time>`, nowrap, tabular figures; "—" when there is none. */
259
+ function FeedbackDate({ value, renderDate }: { value: string | null | undefined; renderDate: FeedbackRenderDate }) {
260
+ if (!value) return <span className="text-[var(--text-placeholder)]">{EMPTY_FORMATTED_VALUE}</span>;
261
+ return (
262
+ <time dateTime={value} className="whitespace-nowrap tabular-nums text-[var(--text-muted)]">
263
+ {renderDate(value)}
264
+ </time>
265
+ );
266
+ }
267
+
268
+ /** An instant for sorting; a value that does not parse sorts with the empty ones. */
269
+ function instant(value: string | null | undefined): number | null {
270
+ const ms = value ? Date.parse(value) : NaN;
271
+ return Number.isNaN(ms) ? null : ms;
272
+ }
273
+
274
+ /* ── The subject: title + environment chip + rework chip ───────────────────── */
275
+
276
+ export interface FeedbackSubjectProps {
277
+ row: Pick<FeedbackRecord, "title" | "body" | "context">;
278
+ /**
279
+ * `false` (default): one line — the title truncates and the chips stay whole, as a
280
+ * table cell wants. `true`: the title wraps and the chips flow after its last word, as
281
+ * the phone card wants (a phone shows the whole title or nothing useful).
282
+ */
283
+ wrap?: boolean;
284
+ /** Over the `feedbackPage` namespace. */
285
+ labels?: Partial<FeedbackPageLabels>;
286
+ className?: string;
287
+ }
288
+
289
+ /**
290
+ * A report's title with its two chips (§4.3, column 4): the environment when it is not
291
+ * production (keksdose's amber outline, the top bar's environment badge — the marker the
292
+ * tester saw is the marker triage sees) and **Rework** / **Rework ×n** when the author has
293
+ * sent it back (keksdose live #331: *"have a new category for items in rework"*, as a fact
294
+ * derived from the body rather than a seventh status).
295
+ *
296
+ * No tooltip on either chip (keksdose dev#523): each already says what it means.
297
+ */
298
+ export function FeedbackSubject({ row, wrap = false, labels: labelsProp, className }: FeedbackSubjectProps) {
299
+ const labels = useFeedbackPageLabels(labelsProp);
300
+ const env = feedbackEnvironment(row.context);
301
+ const rounds = reworkCount(row.body ?? "");
302
+ const chipClass = wrap ? "ms-1.5 align-middle" : "shrink-0";
303
+ const chips = (
304
+ <>
305
+ {env && (
306
+ <Chip size="sm" variant="outline" shape="square" tone="warning" caps className={chipClass} data-feedback-env="">
307
+ {labels.environment(env)}
308
+ </Chip>
309
+ )}
310
+ {rounds > 0 && (
311
+ <Chip size="sm" tone="warning" caps className={chipClass} data-feedback-rework={rounds}>
312
+ {labels.reworkChip(rounds)}
313
+ </Chip>
314
+ )}
315
+ </>
316
+ );
317
+ if (wrap) {
318
+ return (
319
+ <span className={cn("min-w-0 font-medium [overflow-wrap:anywhere]", className)}>
320
+ {row.title}
321
+ {chips}
322
+ </span>
323
+ );
324
+ }
325
+ return (
326
+ <span className={cn("inline-flex min-w-0 max-w-full items-center gap-1.5", className)}>
327
+ <span className="min-w-0 truncate font-medium">{row.title}</span>
328
+ {chips}
329
+ </span>
330
+ );
331
+ }
332
+
333
+ /* ── The URL cell ───────────────────────────────────────────────────────────── */
334
+
335
+ /**
336
+ * The page a report was filed from, as a link — the cell keksdose's column 7 draws
337
+ * (:850): the path as text, path + query + hash as the `href`, read from `context.url`
338
+ * else `context.route` by the row detail's own readers (`feedbackPagePath` /
339
+ * `feedbackPageHref`, feedback-row-detail.tsx), so the column and the detail link the
340
+ * same page the same way. A real link through the `<UiKitProvider linkComponent>` (the app's router, so it
341
+ * does not reload the app; keksdose's plain `<a>` did), and its click stops at the cell so
342
+ * the row does not open as well.
343
+ *
344
+ * Its name is the path, as on screen, with "Open page" said before it — keksdose's
345
+ * `aria-label="Open page"` replaced the path, so a screen reader heard forty identical
346
+ * links down the column.
347
+ */
348
+ function FeedbackPageLinkCell({ context, openPage }: { context: FeedbackContext | null; openPage: string }) {
349
+ const kitLink = useKitLink();
350
+ const href = feedbackPageHref(context);
351
+ const path = feedbackPagePath(context);
352
+ if (!href || !path) return <span className="text-[var(--text-placeholder)]">{EMPTY_FORMATTED_VALUE}</span>;
353
+ const className =
354
+ "inline-flex min-w-0 max-w-full items-center gap-1 text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:underline";
355
+ const children = (
356
+ <>
357
+ {/* The space outside the hidden span: a flex container drops it from the layout,
358
+ and the accessible name keeps it ("Open page /accounts"). */}
359
+ <span className="sr-only">{openPage}</span>{" "}
360
+ <code className="min-w-0 truncate text-xs">{path}</code>
361
+ <ExternalLink className="size-3 shrink-0" aria-hidden />
362
+ </>
363
+ );
364
+ const onClick = (event: MouseEvent<HTMLAnchorElement>) => event.stopPropagation();
365
+ const render = pickLinkRenderer<KitLinkProps>(undefined, kitLink, href);
366
+ return render ? (
367
+ <RenderedLink render={render} href={href} className={className} onClick={onClick}>
368
+ {children}
369
+ </RenderedLink>
370
+ ) : (
371
+ <a href={href} className={className} onClick={onClick}>
372
+ {children}
373
+ </a>
374
+ );
375
+ }
376
+
377
+ /** The provider's link, drawn by a component declared once (as FloatingAction's). */
378
+ function RenderedLink({ render, ...props }: KitLinkProps & { render: (props: KitLinkProps) => ReactElement }) {
379
+ return render(props);
380
+ }
381
+
382
+ /* ── The columns ────────────────────────────────────────────────────────────── */
383
+
384
+ /** What {@link feedbackColumns} takes — every word already resolved (see
385
+ * {@link useFeedbackColumns}, which resolves them from the provider). */
386
+ export interface FeedbackColumnsOptions {
387
+ /** `/my-feedback`. The same nine columns (one page component, §4.3), but the status
388
+ * cell is read-only there whatever `canEdit` says — "no status or outcome editing
389
+ * there (also for an admin)". */
390
+ mine?: boolean;
391
+ /** The admin on `/feedback` — the status cell offers its steps. Otherwise it shows them
392
+ * read-only. */
393
+ canEdit: boolean;
394
+ /** The undoable status change, `useFeedbackStatusUndo(update.mutate)` (§4.5) — the
395
+ * same one the row detail and the swipes use. */
396
+ onStatus: FeedbackStatusChange;
397
+ /** See {@link FeedbackRenderDate}. */
398
+ renderDate: FeedbackRenderDate;
399
+ /** The status buttons SAVE when pressed: pass `true` to put them under the page's
400
+ * `WriteLockProvider` (FeedbackStatusTransitions' `commit`). Off by default — a
401
+ * feedback inbox is rarely what an app's lock is about. */
402
+ commit?: boolean;
403
+ labels: FeedbackPageLabels;
404
+ statusLabels: FeedbackStatusLabels;
405
+ categoryLabels: FeedbackCategoryLabels;
406
+ }
407
+
408
+ /** A status's place in the chain, unknown ones last (as `feedbackCategoryRank`). */
409
+ function statusRank(status: FeedbackStatus): number {
410
+ const at = FEEDBACK_STATUS_ORDER.indexOf(status);
411
+ return at === -1 ? FEEDBACK_STATUS_ORDER.length : at;
412
+ }
413
+
414
+ /**
415
+ * The nine columns of §4.3, in the contract's order, for `DataTable` — keksdose's
416
+ * (:711–963) with the contract's changes:
417
+ *
418
+ * | # | key | cell | filter | phone |
419
+ * |---|---|---|---|---|
420
+ * | 1 | `id` | id, mono | number | hidden |
421
+ * | 2 | `date` | `created_at`, weekday ({@link FeedbackRenderDate}) | date | |
422
+ * | 3 | `category` | `FeedbackCategoryBadge`, sorted CRASH first | select, all five | |
423
+ * | 4 | `title` | {@link FeedbackSubject} | text: title + environment | card heading |
424
+ * | 5 | `user` | {@link feedbackSubmitter} | text: name + email, or "deleted user" | |
425
+ * | 6 | `email` | {@link feedbackSubmitterEmail} | text | hidden |
426
+ * | 7 | `url` | the page, a link (`noRowLink`) | text: path | hidden |
427
+ * | 8 | `status` | `FeedbackStatusTransitions variant="icon"`, `visibleFeedbackStatuses` | select, chain order | |
428
+ * | 9 | `resolved` | `resolved_at` | date | hidden |
429
+ *
430
+ * - Both select filters list the WHOLE vocabulary in its own order, translated —
431
+ * without `options` the popover lists the bare enum values found in the rows
432
+ * (keksdose feedback #160), and kastlan's first CRASH row would otherwise appear in a
433
+ * filter that never offered it.
434
+ * - The status column owns the status filter, and only it (keksdose live #330's revert:
435
+ * the phone's filter sheet already exposes every column filter).
436
+ * - `/my-feedback` shows the same nine: the Email cell's context fallback exists for it
437
+ * (the admin list's join is absent there, §3.1), and its phone card drops the submitter
438
+ * instead ({@link FeedbackMobileCardProps.showSubmitter}).
439
+ *
440
+ * Pure: hand it resolved words, or use {@link useFeedbackColumns}. Keys are stable, so
441
+ * an app may drop or add a column (`columns.filter((c) => c.key !== "email")`).
442
+ */
443
+ export function feedbackColumns<T extends FeedbackTableRow>({
444
+ mine = false,
445
+ canEdit,
446
+ onStatus,
447
+ renderDate,
448
+ commit,
449
+ labels,
450
+ statusLabels,
451
+ categoryLabels,
452
+ }: FeedbackColumnsOptions): DataTableColumn<T>[] {
453
+ const editable = canEdit && !mine;
454
+ return [
455
+ {
456
+ key: "id",
457
+ header: labels.columnId,
458
+ cell: (row) => <span className="font-mono text-xs text-[var(--text-muted)]">{row.id}</span>,
459
+ sortBy: (row) => row.id,
460
+ filter: { type: "number", getValue: (row) => row.id },
461
+ mobileHidden: true,
462
+ },
463
+ {
464
+ key: "date",
465
+ header: labels.columnDate,
466
+ cell: (row) => <FeedbackDate value={row.created_at} renderDate={renderDate} />,
467
+ sortBy: (row) => instant(row.created_at),
468
+ filter: { type: "date", getValue: (row) => row.created_at },
469
+ },
470
+ {
471
+ key: "category",
472
+ header: labels.columnCategory,
473
+ cell: (row) => <FeedbackCategoryBadge category={row.category} label={categoryLabels[row.category]} />,
474
+ sortBy: (row) => feedbackCategoryRank(row.category),
475
+ filter: {
476
+ type: "select",
477
+ getValue: (row) => row.category,
478
+ options: FEEDBACK_CATEGORY_ORDER.map((value) => ({ value, label: categoryLabels[value] })),
479
+ },
480
+ },
481
+ {
482
+ key: "title",
483
+ header: labels.columnSubject,
484
+ cell: (row) => <FeedbackSubject row={row} labels={labels} />,
485
+ sortBy: (row) => row.title,
486
+ // Searchable by the environment too, so "dev" narrows to the test copy's reports —
487
+ // a chip you can see but not filter by makes you read every row (keksdose :804).
488
+ filterBy: (row) => {
489
+ const env = feedbackEnvironment(row.context);
490
+ return env ? `${row.title} ${labels.environment(env)}` : row.title;
491
+ },
492
+ mobilePrimary: true,
493
+ },
494
+ {
495
+ key: "user",
496
+ header: labels.columnUser,
497
+ cell: (row) => <span className="text-[var(--text-secondary)]">{feedbackSubmitter(row, labels)}</span>,
498
+ sortBy: (row) => feedbackSubmitter(row, labels),
499
+ // Name AND email, so either finds the person; the erased ones by the placeholder
500
+ // (their context holds no name any more).
501
+ filterBy: (row) =>
502
+ row.user_id == null
503
+ ? labels.deletedUser
504
+ : `${feedbackSubmitter(row, labels)} ${feedbackSubmitterEmail(row)}`,
505
+ },
506
+ {
507
+ key: "email",
508
+ header: labels.columnEmail,
509
+ // One line, like the URL beside it: keksdose's `break-all` let the browser squeeze
510
+ // the column to its header and broke every address in two ("user@exam / ple.test"),
511
+ // which made every row taller. Unbroken, a resized (pinned) column ellipsises it.
512
+ className: "whitespace-nowrap",
513
+ cell: (row) => {
514
+ const email = feedbackSubmitterEmail(row);
515
+ return email ? (
516
+ <span className="text-[var(--text-secondary)]">{email}</span>
517
+ ) : (
518
+ <span className="text-[var(--text-placeholder)]">{EMPTY_FORMATTED_VALUE}</span>
519
+ );
520
+ },
521
+ sortBy: feedbackSubmitterEmail,
522
+ filterBy: feedbackSubmitterEmail,
523
+ mobileHidden: true,
524
+ },
525
+ {
526
+ key: "url",
527
+ header: labels.columnUrl,
528
+ // A cell only ellipsises what it is told not to wrap (keksdose live #348: the path
529
+ // clipped mid-character "behind the next column").
530
+ className: "whitespace-nowrap",
531
+ // The cell IS a link, so the row's own permalink must never wrap it (keksdose
532
+ // feedback #451: <a> in <a>, and "open the page" silently did nothing).
533
+ noRowLink: true,
534
+ cell: (row) => <FeedbackPageLinkCell context={row.context} openPage={labels.openPage} />,
535
+ sortBy: (row) => feedbackPagePath(row.context) ?? "",
536
+ filterBy: (row) => feedbackPagePath(row.context) ?? "",
537
+ mobileHidden: true,
538
+ },
539
+ {
540
+ key: "status",
541
+ header: labels.columnStatus,
542
+ // A KNOWN width: at most six 28px icon buttons (from IN_PROGRESS or IN_EVALUATION:
543
+ // one step either way and the three off the chain) — keksdose live #348 sized it
544
+ // for five and the sixth pushed the column wider.
545
+ className: "w-[13.5rem] whitespace-nowrap",
546
+ cell: (row) => (
547
+ <FeedbackStatusTransitions
548
+ status={row.status}
549
+ statuses={visibleFeedbackStatuses(row.status)}
550
+ canEdit={editable}
551
+ commit={commit}
552
+ onPick={(status) => onStatus(row, status)}
553
+ variant="icon"
554
+ label={(status) => statusLabels[status]}
555
+ />
556
+ ),
557
+ sortBy: (row) => statusRank(row.status),
558
+ filter: {
559
+ type: "select",
560
+ getValue: (row) => row.status,
561
+ options: FEEDBACK_STATUS_ORDER.map((value) => ({ value, label: statusLabels[value] })),
562
+ },
563
+ },
564
+ {
565
+ key: "resolved",
566
+ header: labels.columnResolved,
567
+ cell: (row) => <FeedbackDate value={row.resolved_at} renderDate={renderDate} />,
568
+ sortBy: (row) => instant(row.resolved_at),
569
+ filter: { type: "date", getValue: (row) => row.resolved_at },
570
+ mobileHidden: true,
571
+ },
572
+ ];
573
+ }
574
+
575
+ /** What {@link useFeedbackColumns} takes: {@link FeedbackColumnsOptions} with the words
576
+ * read from the provider, and `renderDate` optional. */
577
+ export interface UseFeedbackColumnsOptions
578
+ extends Omit<FeedbackColumnsOptions, "renderDate" | "labels" | "statusLabels" | "categoryLabels"> {
579
+ /** Default: the kit's date with the weekday ({@link useFeedbackRenderDate}). */
580
+ renderDate?: FeedbackRenderDate;
581
+ /** Over the `feedbackPage` namespace. Keep it stable (module scope or memoised): it is
582
+ * a dependency of the memo. */
583
+ labels?: Partial<FeedbackPageLabels>;
584
+ }
585
+
586
+ /**
587
+ * {@link feedbackColumns} with the `feedbackPage`, `feedbackStatus` and
588
+ * `feedbackCategory` words from the provider, memoised on what it reads — pass
589
+ * `update.mutate` through `useFeedbackStatusUndo` (stable) rather than a fresh function
590
+ * per render, or every row's columns are rebuilt on each render (keksdose :667).
591
+ */
592
+ export function useFeedbackColumns<T extends FeedbackTableRow>({
593
+ mine,
594
+ canEdit,
595
+ onStatus,
596
+ renderDate: renderDateProp,
597
+ commit,
598
+ labels: labelsProp,
599
+ }: UseFeedbackColumnsOptions): DataTableColumn<T>[] {
600
+ const labels = useFeedbackPageLabels(labelsProp);
601
+ const statusLabels = useFeedbackStatusLabels();
602
+ const categoryLabels = useFeedbackCategoryLabels();
603
+ const renderDate = useFeedbackRenderDate(renderDateProp);
604
+ return useMemo(
605
+ () =>
606
+ feedbackColumns<T>({ mine, canEdit, onStatus, renderDate, commit, labels, statusLabels, categoryLabels }),
607
+ [mine, canEdit, onStatus, renderDate, commit, labels, statusLabels, categoryLabels],
608
+ );
609
+ }
610
+
611
+ /* ── The phone ──────────────────────────────────────────────────────────────── */
612
+
613
+ /**
614
+ * The phone list's day headers (keksdose feedback #325: the list "grouped by date, like
615
+ * the transactions list"): `DataTable mobileGroupBy={feedbackMobileGroupBy(renderDate)}`.
616
+ *
617
+ * The key IS the header — the same string the card's date says. DataTable groups runs of
618
+ * equal keys, so the rows must come newest first, as `GET /feedback` and
619
+ * `GET /feedback/my` send them (§3.3).
620
+ */
621
+ export function feedbackMobileGroupBy(
622
+ renderDate: FeedbackRenderDate,
623
+ ): (row: Pick<FeedbackRecord, "created_at">) => string {
624
+ return (row) => renderDate(row.created_at);
625
+ }
626
+
627
+ export interface FeedbackMobileCardProps {
628
+ row: FeedbackTableRow;
629
+ /** Add the submitter after the date — the admin inbox (`canEdit`). On `/my-feedback`
630
+ * every row is the viewer's own and the name would repeat down the list. */
631
+ showSubmitter?: boolean;
632
+ /** See {@link FeedbackRenderDate}; the same function as the columns' and the day
633
+ * headers'. Default: the kit's ({@link useFeedbackRenderDate}). */
634
+ renderDate?: FeedbackRenderDate;
635
+ /** Over the `feedbackPage` namespace. */
636
+ labels?: Partial<FeedbackPageLabels>;
637
+ }
638
+
639
+ /**
640
+ * One report as a phone card (§4.3; keksdose :1042, feedback #325 rework: *"compact card
641
+ * instead of a wasteful label/value row per field"*): the title with its environment and
642
+ * rework chips and the status badge on one line, then the compact category badge, the
643
+ * date and (admin) the submitter beneath.
644
+ *
645
+ * `DataTable mobileCard={(row) => <FeedbackMobileCard row={row} … />}`. It draws the
646
+ * chips itself: with a `mobileCard`, DataTable never renders the `mobilePrimary` cell,
647
+ * which is how keksdose's cards lost them.
648
+ */
649
+ export function FeedbackMobileCard({ row, showSubmitter = false, renderDate: renderDateProp, labels: labelsProp }: FeedbackMobileCardProps) {
650
+ const labels = useFeedbackPageLabels(labelsProp);
651
+ const renderDate = useFeedbackRenderDate(renderDateProp);
652
+ return (
653
+ <div className="min-w-0 space-y-1">
654
+ <div className="flex items-start justify-between gap-2">
655
+ <FeedbackSubject row={row} wrap labels={labels} className="flex-1" />
656
+ {/* The pill the desktop status column draws, so a status is the same colour and
657
+ glyph on both layouts. */}
658
+ <FeedbackStatusBadge status={row.status} className="shrink-0" />
659
+ </div>
660
+ <div className="flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-[var(--text-muted)]">
661
+ <FeedbackCategoryBadge category={row.category} compact />
662
+ <FeedbackDate value={row.created_at} renderDate={renderDate} />
663
+ {showSubmitter && (
664
+ // The short id form: "#7" says enough on a card that has room for little.
665
+ <span className="min-w-0 truncate">
666
+ · {feedbackSubmitter(row, { deletedUser: labels.deletedUser, userFallback: (id) => `#${id}` })}
667
+ </span>
668
+ )}
669
+ </div>
670
+ </div>
671
+ );
672
+ }
673
+
674
+ export interface FeedbackAwaitingToggleProps {
675
+ /** Narrowed to what waits on the triager. Page state, not the URL (keksdose :699): a
676
+ * thumb gesture on one screen, not a view worth linking to. */
677
+ pressed: boolean;
678
+ onPressedChange: (pressed: boolean) => void;
679
+ /** Further `FloatingAction`s, after the toggle — the group is what makes them free. */
680
+ children?: ReactNode;
681
+ /** Default `bottom-end`, the register's corner. */
682
+ corner?: FloatingCorner;
683
+ /** Over the group's default distance from the bottom. */
684
+ offset?: string;
685
+ /** On the group. It is `md:hidden` already: the desktop has the status column's
686
+ * filter, the same question asked where there is room for it. */
687
+ className?: string;
688
+ /** Over the `feedbackPage` namespace. */
689
+ labels?: Partial<FeedbackPageLabels>;
690
+ }
691
+
692
+ /**
693
+ * The phone inbox's one filter button — **"Only what is waiting for you"** (§4.3;
694
+ * keksdose live #330 rework: *"a button that toggles the evaluation items (in evaluation,
695
+ * test when live) as toggle button similar to the show/hide upcoming/scheduled for the tx
696
+ * page"*).
697
+ *
698
+ * It narrows TO `FEEDBACK_AWAITING_STATUSES` rather than hiding them: after a loop run
699
+ * those ARE the queue — the rows handed back for a verdict — and everything else is
700
+ * history. A `FloatingActionGroup` with one member anyway, in the register's corner and
701
+ * shape (keksdose feedback #58), so a second action costs nothing; the glyph is
702
+ * IN_EVALUATION's own, so the button reads in the vocabulary of the badges it filters on.
703
+ *
704
+ * Admin inbox only: on `/my-feedback` the author is not waiting on their own verdict.
705
+ * The filtering is the page's — `rows.filter((r) => isFeedbackAwaiting(r.status))` —
706
+ * so the table's own filters, sort and URL stay untouched.
707
+ */
708
+ export function FeedbackAwaitingToggle({
709
+ pressed,
710
+ onPressedChange,
711
+ children,
712
+ corner,
713
+ offset,
714
+ className,
715
+ labels: labelsProp,
716
+ }: FeedbackAwaitingToggleProps) {
717
+ const labels = useFeedbackPageLabels(labelsProp);
718
+ const Icon = FEEDBACK_STATUS_META.IN_EVALUATION.icon;
719
+ return (
720
+ <FloatingActionGroup
721
+ aria-label={labels.phoneActions}
722
+ corner={corner}
723
+ offset={offset}
724
+ className={cn("md:hidden", className)}
725
+ >
726
+ <FloatingAction
727
+ label={labels.awaitingFilter}
728
+ icon={<Icon aria-hidden />}
729
+ pressed={pressed}
730
+ onClick={() => onPressedChange(!pressed)}
731
+ />
732
+ {children}
733
+ </FloatingActionGroup>
734
+ );
735
+ }
736
+
737
+ /* ── Empty ──────────────────────────────────────────────────────────────────── */
738
+
739
+ export interface FeedbackEmptyStateProps {
740
+ /** Over the `feedbackPage` namespace. */
741
+ labels?: Partial<FeedbackPageLabels>;
742
+ }
743
+
744
+ /**
745
+ * The table with nothing to show (§7.13): the one word **None** / **Keine**, on both
746
+ * pages — keksdose's `empty={t("common.none")}` (`feedback-page.tsx:982`). No hint
747
+ * beneath it: where reports are sent from is the feedback menu's business, and the inbox
748
+ * needs no sentence to say it is empty.
749
+ *
750
+ * For `DataTable empty`, which sits in a centred, muted cell — so no box of its own.
751
+ * keksdose passes it unconditionally, so a filter (or the awaiting toggle) that leaves
752
+ * nothing says "None" too: `empty={<FeedbackEmptyState />}`.
753
+ */
754
+ export function FeedbackEmptyState({ labels: labelsProp }: FeedbackEmptyStateProps) {
755
+ const labels = useFeedbackPageLabels(labelsProp);
756
+ return <span data-feedback-empty="">{labels.empty}</span>;
757
+ }