@@ -42,9 +42,9 @@ export function SortableTable({
|
||||
...props
|
||||
}: ComponentProps<typeof Table> & {
|
||||
refetch: (o: { order: Order }) => void;
|
||||
hasNext: boolean;
|
||||
loadNext: (...args: any[]) => void;
|
||||
isLoadingNext: boolean;
|
||||
hasNext?: boolean;
|
||||
loadNext?: (...args: any[]) => void;
|
||||
isLoadingNext?: boolean;
|
||||
}) {
|
||||
const { __ } = useTranslate();
|
||||
const [order, setOrder] = useState(defaultOrder);
|
||||
@@ -58,7 +58,7 @@ export function SortableTable({
|
||||
<SortableContext value={{ order, onOrderChange }}>
|
||||
<div className="space-y-4">
|
||||
<Table {...props} />
|
||||
{hasNext && (
|
||||
{hasNext && loadNext && (
|
||||
<Button
|
||||
variant="tertiary"
|
||||
onClick={() => loadNext()}
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
import { graphql } from "relay-runtime";
|
||||
import {
|
||||
useMutation,
|
||||
usePreloadedQuery,
|
||||
type PreloadedQuery,
|
||||
} from "react-relay";
|
||||
import { useMutation } from "react-relay";
|
||||
import { useConfirm } from "@probo/ui";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { promisifyMutation, sprintf } from "@probo/helpers";
|
||||
import { useMemo } from "react";
|
||||
import type { AssetGraphListQuery } from "./__generated__/AssetGraphListQuery.graphql";
|
||||
|
||||
export const assetsQuery = graphql`
|
||||
query AssetGraphListQuery($organizationId: ID!) {
|
||||
|
||||
@@ -5,7 +5,6 @@ import {
|
||||
useMutation,
|
||||
usePaginationFragment,
|
||||
usePreloadedQuery,
|
||||
useRefetchableFragment,
|
||||
type PreloadedQuery,
|
||||
} from "react-relay";
|
||||
import { useMemo } from "react";
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { usePageTitle } from "@probo/hooks";
|
||||
import {
|
||||
graphql,
|
||||
usePaginationFragment,
|
||||
usePreloadedQuery,
|
||||
type PreloadedQuery,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import {
|
||||
PageHeader,
|
||||
Table,
|
||||
Tbody,
|
||||
Thead,
|
||||
Tr,
|
||||
|
||||
@@ -2,7 +2,6 @@ import {
|
||||
Button,
|
||||
IconPlusLarge,
|
||||
PageHeader,
|
||||
Table,
|
||||
Thead,
|
||||
Tbody,
|
||||
Tr,
|
||||
@@ -31,14 +30,14 @@ import {
|
||||
useDeleteVendor,
|
||||
vendorsQuery,
|
||||
} from "/hooks/graph/VendorGraph";
|
||||
import type { VendorGraphListQuery } from "/hooks/graph/__generated__/VendorGraphListQuery.graphql";
|
||||
import type {
|
||||
VendorGraphListQuery,
|
||||
VendorGraphListQuery$data,
|
||||
} from "/hooks/graph/__generated__/VendorGraphListQuery.graphql";
|
||||
import type { VendorGraphPaginatedFragment$key } from "/hooks/graph/__generated__/VendorGraphPaginatedFragment.graphql";
|
||||
VendorGraphPaginatedFragment$data,
|
||||
VendorGraphPaginatedFragment$key,
|
||||
} from "/hooks/graph/__generated__/VendorGraphPaginatedFragment.graphql";
|
||||
import { SortableTable } from "/components/SortableTable";
|
||||
|
||||
type Vendor = NodeOf<VendorGraphListQuery$data["node"]["vendors"]>;
|
||||
type Vendor = NodeOf<VendorGraphPaginatedFragment$data["vendors"]>;
|
||||
|
||||
type Props = {
|
||||
queryRef: PreloadedQuery<VendorGraphListQuery>;
|
||||
|
||||
Reference in New Issue
Block a user