Skip to content

Commit c32443f

Browse files
committed
Add empty placeholderst ot he tab-consumers and tab-partitions
1 parent c27da9c commit c32443f

2 files changed

Lines changed: 28 additions & 12 deletions

File tree

frontend/src/components/pages/topics/tab-consumers.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,21 @@ export const TopicConsumers: FC<TopicConsumersProps> = ({ topic }) => {
152152
))}
153153
</TableHeader>
154154
<TableBody>
155-
{table.getRowModel().rows.map((row) => (
156-
<TableRow key={row.id}>
157-
{row.getVisibleCells().map((cell) => (
158-
<TableCell key={cell.id}>{flexRender(cell.column.columnDef.cell, cell.getContext())}</TableCell>
159-
))}
155+
{table.getRowModel().rows.length === 0 ? (
156+
<TableRow>
157+
<TableCell className="text-center" colSpan={columns.length}>
158+
No data found
159+
</TableCell>
160160
</TableRow>
161-
))}
161+
) : (
162+
table.getRowModel().rows.map((row) => (
163+
<TableRow key={row.id}>
164+
{row.getVisibleCells().map((cell) => (
165+
<TableCell key={cell.id}>{flexRender(cell.column.columnDef.cell, cell.getContext())}</TableCell>
166+
))}
167+
</TableRow>
168+
))
169+
)}
162170
</TableBody>
163171
</Table>
164172
<DataTablePagination table={table} />

frontend/src/components/pages/topics/tab-partitions.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,21 @@ export const TopicPartitions: FC<TopicPartitionsProps> = ({ topic }) => {
188188
))}
189189
</TableHeader>
190190
<TableBody>
191-
{table.getRowModel().rows.map((row) => (
192-
<TableRow key={row.id}>
193-
{row.getVisibleCells().map((cell) => (
194-
<TableCell key={cell.id}>{flexRender(cell.column.columnDef.cell, cell.getContext())}</TableCell>
195-
))}
191+
{table.getRowModel().rows.length === 0 ? (
192+
<TableRow>
193+
<TableCell className="text-center" colSpan={columns.length}>
194+
No data found
195+
</TableCell>
196196
</TableRow>
197-
))}
197+
) : (
198+
table.getRowModel().rows.map((row) => (
199+
<TableRow key={row.id}>
200+
{row.getVisibleCells().map((cell) => (
201+
<TableCell key={cell.id}>{flexRender(cell.column.columnDef.cell, cell.getContext())}</TableCell>
202+
))}
203+
</TableRow>
204+
))
205+
)}
198206
</TableBody>
199207
</Table>
200208
<DataTablePagination table={table} />

0 commit comments

Comments
 (0)