chore: remove unused page-query-container component (#2407)
This commit is contained in:
parent
7a56e1695d
commit
070f2a2045
@ -1 +0,0 @@
|
|||||||
export { PageQueryContainer } from './page-query-container';
|
|
@ -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}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
Loading…
Reference in New Issue
Block a user