diff --git a/src/hooks/index.ts b/src/hooks/index.ts index e0f6038..7746976 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -4,6 +4,7 @@ export * from './useFilteredMods' export * from './useGames' export * from './useMuteLists' export * from './useNSFWList' +export * from './useRepostList' export * from './useReactions' export * from './useNDKContext' export * from './useScrollDisable' diff --git a/src/hooks/useRepostList.tsx b/src/hooks/useRepostList.tsx new file mode 100644 index 0000000..605bc8d --- /dev/null +++ b/src/hooks/useRepostList.tsx @@ -0,0 +1,19 @@ +import { useState } from 'react' +import { useDidMount } from './useDidMount' +import { useNDKContext } from './useNDKContext' +import { CurationSetIdentifiers, getReportingSet } from 'utils' + +export const useRepostList = () => { + const ndkContext = useNDKContext() + const [repostList, setRepostList] = useState([]) + + useDidMount(async () => { + const list = await getReportingSet( + CurationSetIdentifiers.Repost, + ndkContext + ) + setRepostList(list) + }) + + return repostList +}