import { SyntheticEvent } from 'react'; import { SerializableProperty } from '../../serializers'; export type UseLoadPropertiesResults = { properties: SerializableProperty[]; previousProperties: SerializableProperty[]; onLoadMore: (e: SyntheticEvent) => void; onLoadPrevious: (e: SyntheticEvent) => void; loadingNextProperties: boolean; loadingPreviousProperties: boolean; hasNextPage?: boolean; hasPreviousPage?: boolean; nextPageSearchUrl: string; previousPageSearchUrl: string; }; export type UseLoadPropertiesProps = { fragment: string[]; channel: string; county?: string; location?: string; pageSize: number; postcode?: string; branch?: string; sortOrder?: string; }; /** * Used to render properties, loading state, a load more handler for property results * and a hasNextPage state to be used to conditionally render the load more button. * * Due to search engines' inability to crawl successive search pages when using * "Load More" functionality, the `onLoadMore` handler should be applied to a * NextJS `Link` component instead of an HTML `