- {user.first_name?.[0] || user.username?.[0] || '?'}
-
+ {user.first_name?.[0] || user.username?.[0] || '?'}
+
-
{user.full_name}
+
+
+ {user.full_name}
+
+ {canExpand && (
+
+ {subCount}
+
+ )}
+
{user.username ? `@${user.username}` : `ID: ${user.telegram_id}`}
@@ -1325,7 +1618,7 @@ export default function AdminBulkActions() {
},
},
],
- [t, formatWithCurrency],
+ [t, formatWithCurrency, expandedRows, toggleExpandRow],
);
const table = useReactTable({
@@ -1474,25 +1767,50 @@ export default function AdminBulkActions() {
))}
- {table.getRowModel().rows.map((row) => (
-
- {row.getVisibleCells().map((cell) => (
- {
+ const user = row.original;
+ const subs = user.subscriptions ?? [];
+ const canExpand = subs.length > 1;
+ const isExpanded = expandedRows[user.id] ?? false;
+
+ return (
+
+ {/* User row */}
+
- {flexRender(cell.column.columnDef.cell, cell.getContext())}
-
- ))}
-
- ))}
+ {row.getVisibleCells().map((cell) => (
+
+ {flexRender(cell.column.columnDef.cell, cell.getContext())}
+ |
+ ))}
+ |
+
+ {/* Subscription sub-rows (only when expanded and multi-sub) */}
+ {canExpand &&
+ isExpanded &&
+ subs.map((sub) => (
+ toggleSubscriptionSelection(sub.id)}
+ isMultiTariff={isMultiTariff}
+ />
+ ))}
+
+ {/* Single subscription — auto-select with user (no separate sub-row) */}
+
+ );
+ })}
@@ -1509,7 +1827,7 @@ export default function AdminBulkActions() {