mirror of
https://github.com/luxfi/market.git
synced 2026-09-24 00:25:57 +00:00
31 lines
741 B
TypeScript
31 lines
741 B
TypeScript
import { FC, useEffect } from 'react'
|
|
import { ActivityTable } from 'components/common/ActivityTable'
|
|
import { useCollectionActivity } from '@reservoir0x/reservoir-kit-ui'
|
|
|
|
type Props = {
|
|
id: string | undefined
|
|
activityTypes: NonNullable<
|
|
Exclude<Parameters<typeof useCollectionActivity>['0'], boolean>
|
|
>['types']
|
|
}
|
|
|
|
export const CollectionAcivityTable: FC<Props> = ({ id, activityTypes }) => {
|
|
const data = useCollectionActivity(
|
|
{ collection: id, types: activityTypes, limit: 20 },
|
|
{
|
|
revalidateOnMount: true,
|
|
fallbackData: [],
|
|
revalidateFirstPage: true,
|
|
}
|
|
)
|
|
|
|
useEffect(() => {
|
|
data.mutate()
|
|
return () => {
|
|
data.setSize(1)
|
|
}
|
|
}, [])
|
|
|
|
return <ActivityTable data={data} />
|
|
}
|