Add all filters to tables + make column width fixed (#133)
* Add additional filters on companies and people page * Make colunn width fixed * Remove duplicate declaration of Unknown type
This commit is contained in:
@ -1,7 +1,10 @@
|
||||
import { gql, useQuery } from '@apollo/client';
|
||||
import { useMemo, useState } from 'react';
|
||||
import { SearchConfigType } from '../../../interfaces/search/interface';
|
||||
import { AnyEntity } from '../../../interfaces/entities/generic.interface';
|
||||
import {
|
||||
AnyEntity,
|
||||
UnknownType,
|
||||
} from '../../../interfaces/entities/generic.interface';
|
||||
|
||||
export const SEARCH_PEOPLE_QUERY = gql`
|
||||
query SearchPeopleQuery($where: people_bool_exp, $limit: Int) {
|
||||
@ -58,15 +61,16 @@ const debounce = <FuncArgs extends any[]>(
|
||||
};
|
||||
};
|
||||
|
||||
export type SearchResultsType<T extends AnyEntity = AnyEntity> = {
|
||||
results: {
|
||||
render: (value: T) => string;
|
||||
value: T;
|
||||
}[];
|
||||
loading: boolean;
|
||||
};
|
||||
export type SearchResultsType<T extends AnyEntity | UnknownType = UnknownType> =
|
||||
{
|
||||
results: {
|
||||
render: (value: T) => string;
|
||||
value: T;
|
||||
}[];
|
||||
loading: boolean;
|
||||
};
|
||||
|
||||
export const useSearch = <T extends AnyEntity = AnyEntity>(): [
|
||||
export const useSearch = <T extends AnyEntity | UnknownType = UnknownType>(): [
|
||||
SearchResultsType<T>,
|
||||
React.Dispatch<React.SetStateAction<string>>,
|
||||
React.Dispatch<React.SetStateAction<SearchConfigType<T> | null>>,
|
||||
|
||||
Reference in New Issue
Block a user