mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 07:03:38 +00:00
Add state when no results with search
Signed-off-by: soupette <cyril@strapi.io>
This commit is contained in:
parent
460ea349e6
commit
8b278955bc
@ -12,18 +12,27 @@ import {
|
||||
Row,
|
||||
} from '@strapi/parts';
|
||||
import { EditIcon, DeleteIcon } from '@strapi/icons';
|
||||
import { EmptyBodyTable, Status } from '@strapi/helper-plugin';
|
||||
import { EmptyBodyTable, Status, useQueryParams } from '@strapi/helper-plugin';
|
||||
import TableHead from './TableHead';
|
||||
|
||||
const Table = ({ canDelete, canUpdate, rows }) => {
|
||||
const [{ query }] = useQueryParams();
|
||||
const ROW_COUNT = rows.length + 1;
|
||||
const COL_COUNT = 7;
|
||||
const hasFilters = query.filters !== undefined;
|
||||
const content = hasFilters
|
||||
? {
|
||||
id: 'content-manager.components.TableEmpty.withFilters',
|
||||
defaultMessage: 'There are no {contentType} with the applied filters...',
|
||||
values: { contentType: 'Users' },
|
||||
}
|
||||
: undefined;
|
||||
|
||||
return (
|
||||
<TableCompo colCount={COL_COUNT} rowCount={ROW_COUNT}>
|
||||
<TableHead />
|
||||
{!rows.length ? (
|
||||
<EmptyBodyTable colSpan={COL_COUNT} />
|
||||
<EmptyBodyTable colSpan={COL_COUNT} content={content} />
|
||||
) : (
|
||||
<Tbody>
|
||||
{rows.map(entry => (
|
||||
|
||||
@ -270,7 +270,6 @@ const ListPage = () => {
|
||||
canDelete={canDelete}
|
||||
canUpdate={canUpdate}
|
||||
rows={data?.results}
|
||||
erows={[]}
|
||||
/>
|
||||
)}
|
||||
</CustomContentLayout>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user