Skip to content

Commit

Permalink
Update "No result" component
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanMarmelab committed Sep 5, 2024
1 parent 66e1ab1 commit 1035319
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/ra-ui-materialui/src/list/ListNoResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@ import * as React from 'react';
import { memo } from 'react';
import CardContent from '@mui/material/CardContent';
import Typography from '@mui/material/Typography';
import { useResourceContext, useTranslate } from 'ra-core';
import { useListController, useResourceContext, useTranslate } from 'ra-core';
import { Link } from '@mui/material';

export const ListNoResults = memo(() => {
const translate = useTranslate();
const resource = useResourceContext();
const { setFilters } = useListController({ resource });
return (
<CardContent>
<Typography variant="body2">
{translate('ra.navigation.no_results', { resource })}
{translate('ra.navigation.no_results', { resource })}{' '}
<Link component="button" onClick={() => setFilters({}, [])}>
{translate('ra.navigation.clear_filters')}
</Link>
</Typography>
</CardContent>
);
Expand Down

0 comments on commit 1035319

Please sign in to comment.