mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
17 lines
550 B
TypeScript
17 lines
550 B
TypeScript
import { useMemo } from 'react';
|
|
import { useAccountCommunities } from '@bitsocial/bitsocial-react-hooks';
|
|
import type { DirectoryCommunity } from './use-directories';
|
|
|
|
export const useAccountCommunitiesWithMetadata = (): DirectoryCommunity[] => {
|
|
const { accountCommunities } = useAccountCommunities({ onlyIfCached: true });
|
|
|
|
return useMemo(
|
|
() =>
|
|
Object.values(accountCommunities).map((community) => ({
|
|
address: (community as any).address,
|
|
title: (community as any).title,
|
|
})),
|
|
[accountCommunities],
|
|
);
|
|
};
|