import { RecordContextProvider, useListContext } from "ra-core";
import type { Company } from "../types";
import { CompanyCard } from "./CompanyCard";
const times = (nbChildren: number, fn: (key: number) => any) =>
Array.from({ length: nbChildren }, (_, key) => fn(key));
const LoadingGridList = () => (
{times(15, (key) => (
))}
);
const LoadedGridList = () => {
const { data, error, isPending } = useListContext();
if (isPending || error) return null;
return (
{data.map((record) => (
))}
{data.length === 0 &&
No companies found
}
);
};
export const ImageList = () => {
const { isPending } = useListContext();
return isPending ? : ;
};