fix(frontend): resolve build-blocking lint and type errors
next build runs ESLint + full type-check and fails on errors (not just warnings) - the production build was broken. Fixes: unused imports/vars, any-typed diff/preference lookups replaced with the actual union/Record types, ternary-as-statement flagged by no-unused-expressions, unescaped JSX entities, a UserPreferences interface missing two fields the video editor already reads/writes at runtime, and an import of ColumnVisibilityState which @tanstack/react-table does not export (the real name is VisibilityState).
This commit is contained in:
@@ -38,8 +38,7 @@ function TagsDiff({ before, after }: { before: string[]; after: string[] }) {
|
||||
|
||||
function DiffRow({ field, item }: { field: string; item: PushPendingPreviewItem }) {
|
||||
const label = FIELD_LABELS[field] ?? field;
|
||||
const diff = item.diff as any;
|
||||
const d = diff[field];
|
||||
const d = item.diff[field as keyof typeof item.diff];
|
||||
if (!d) return null;
|
||||
|
||||
if (field === 'tags') {
|
||||
@@ -47,7 +46,7 @@ function DiffRow({ field, item }: { field: string; item: PushPendingPreviewItem
|
||||
<tr>
|
||||
<td className={styles.diffField}>{label}</td>
|
||||
<td className={styles.diffBefore}>{(d.before as string[]).join(', ') || '—'}</td>
|
||||
<td className={styles.diffAfter}><TagsDiff before={d.before} after={d.after} /></td>
|
||||
<td className={styles.diffAfter}><TagsDiff before={d.before as string[]} after={d.after as string[]} /></td>
|
||||
</tr>
|
||||
);
|
||||
}
|
||||
@@ -60,7 +59,7 @@ function DiffRow({ field, item }: { field: string; item: PushPendingPreviewItem
|
||||
</tr>
|
||||
);
|
||||
}
|
||||
const fmt = (v: any) => {
|
||||
const fmt = (v: string | number | boolean | string[] | null | undefined) => {
|
||||
if (v === null || v === undefined) return '—';
|
||||
if (typeof v === 'boolean') return v ? 'Yes' : 'No';
|
||||
return String(v);
|
||||
|
||||
Reference in New Issue
Block a user