UNPKG

ra-core

Version:

Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React

25 lines 1.1 kB
import React from 'react'; import { type UseReferenceManyFieldControllerParams } from "./useReferenceManyFieldController.js"; /** * Fetch and render the number of records related to the current one * * Relies on dataProvider.getManyReference() returning a total property * * @example // Display the number of comments for the current post * <ReferenceManyCountBase reference="comments" target="post_id" /> * * @example // Display the number of published comments for the current post * <ReferenceManyCountBase reference="comments" target="post_id" filter={{ is_published: true }} /> */ export declare const ReferenceManyCountBase: (props: ReferenceManyCountBaseProps) => React.JSX.Element; export interface ReferenceManyCountRecord { total: number | undefined; } export interface ReferenceManyCountBaseProps extends UseReferenceManyFieldControllerParams { render?: (record: ReferenceManyCountRecord) => React.ReactNode; timeout?: number; loading?: React.ReactNode; error?: React.ReactNode; offline?: React.ReactNode; } //# sourceMappingURL=ReferenceManyCountBase.d.ts.map