import { useGetResourceLabel, useListContextWithProps, useResourceContext, useTranslate, } from "ra-core"; import { Button } from "@/components/ds/ui/button"; export const ListNoResults = (props: ListNoResultsProps) => { const translate = useTranslate(); const resource = useResourceContext(props); const { filterValues, setFilters } = useListContextWithProps(props); const getResourceLabel = useGetResourceLabel(); if (!resource) { throw new Error(" must be used inside a component"); } return (

{filterValues && setFilters && Object.keys(filterValues).length > 0 ? ( <> {translate("ra.navigation.no_filtered_results", { resource, name: getResourceLabel(resource, 0), _: "No results found with the current filters.", })}{" "} ) : ( translate("ra.navigation.no_results", { resource, name: getResourceLabel(resource, 0), _: "No results found.", }) )}

); }; export interface ListNoResultsProps { resource?: string; filterValues?: any; setFilters?: (filters: any, filterTypes?: string[]) => void; }