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