chore: remove unused page-query-container component (#2407)

This commit is contained in:
Matthew Russell 2022-12-16 04:09:57 -06:00 committed by GitHub
parent 7a56e1695d
commit 070f2a2045
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 31 deletions

View File

@ -1 +0,0 @@
export { PageQueryContainer } from './page-query-container';

View File

@ -1,30 +0,0 @@
import type { OperationVariables, QueryHookOptions } from '@apollo/client';
import { useQuery } from '@apollo/client';
import type { DocumentNode } from 'graphql';
import type { ReactNode } from 'react';
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
interface PageQueryContainerProps<TData, TVariables> {
query: DocumentNode;
options?: QueryHookOptions<TData, TVariables>;
render: (data: TData) => ReactNode;
}
export const PageQueryContainer = <TData, TVariables = OperationVariables>({
query,
options,
render,
}: PageQueryContainerProps<TData, TVariables>) => {
const { data, loading, error } = useQuery<TData, TVariables>(query, {
...options,
});
return (
<AsyncRenderer<TData>
loading={loading}
error={error}
data={data}
render={render}
/>
);
};