UNPKG

@chayns-components/person-finder

Version:

A set of beautiful React components for developing your own applications with chayns.

29 lines (28 loc) 1.17 kB
import React, { RefObject } from 'react'; import { LoadingState, PersonFinderEntry } from '../types/personFinder'; export declare const useClosestElementAbove: (containerRef: RefObject<HTMLElement>, itemClass: string) => string | undefined; export declare const usePersonFinderItem: (entry: PersonFinderEntry) => { isSite: boolean; title: string; subtitle: string; imageUrl: string; titleElement: never; }; export declare const usePersonFinderSmallItem: (entry: PersonFinderEntry) => { title: string; }; export declare const useFriends: (personId: string) => { isFriend: boolean | undefined; addFriend: ((personId: string) => void) | undefined; removeFriend: ((personId: string) => void) | undefined; }; export declare const useOnlyFriends: (entries: PersonFinderEntry[]) => boolean; interface UseErrorMessageOptions { loadingState: LoadingState; search: string; entries: PersonFinderEntry[]; groupName?: string; areOnlyFriendsGiven?: boolean; } export declare const useErrorMessage: ({ loadingState, search, entries, groupName, areOnlyFriendsGiven, }: UseErrorMessageOptions) => React.JSX.Element | null; export {};