Skip to content

Commit

Permalink
feat: Support queries as props for the Table component
Browse files Browse the repository at this point in the history
  • Loading branch information
ipapandinas committed Jan 2, 2024
1 parent ac24c4e commit 2694ff4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions components/contributions-table/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@ import { useInfiniteScroll } from "@nextui-org/use-infinite-scroll";
import { Contribution, PaginatedContributions } from "@/types/contribution";
import { Actions, Content, Labels, OpenedDate, Project } from "./row";
import { useContributions } from "@/hooks/useContributions";
import { KudosQueryParameters } from "@/lib/notion/types";

interface ITableProps {
items: PaginatedContributions;
queries?: Partial<KudosQueryParameters>;
}
export const Table = ({ items }: ITableProps) => {
const { data: results, fetchNextPage, hasNextPage } = useContributions(items);
export const Table = ({ items, queries = {} }: ITableProps) => {
const {
data: results,
fetchNextPage,
hasNextPage,
} = useContributions(items, queries);
const [loaderRef, scrollerRef] = useInfiniteScroll({
hasMore: hasNextPage,
onLoadMore: fetchNextPage,
Expand Down

0 comments on commit 2694ff4

Please sign in to comment.