diff --git a/src/components/channels/browseChannelItem.tsx b/src/components/channels/browseChannelItem.tsx index 60b6e791..367f21f2 100644 --- a/src/components/channels/browseChannelItem.tsx +++ b/src/components/channels/browseChannelItem.tsx @@ -2,16 +2,18 @@ import { ImageWithFallback } from '@components/imageWithFallback'; import { DEFAULT_AVATAR } from '@stores/constants'; +import { useChannelMetadata } from '@utils/hooks/useChannelMetadata'; + import { useRouter } from 'next/navigation'; import { useCallback } from 'react'; export const BrowseChannelItem = ({ data }: { data: any }) => { const router = useRouter(); - const channel = JSON.parse(data.content); + const channel = useChannelMetadata(data.event_id, data.metadata); const openChannel = useCallback( (id: string) => { - router.push(`/channels/${id}`); + router.push(`/nostr/channels/${id}`); }, [router] ); @@ -23,15 +25,15 @@ export const BrowseChannelItem = ({ data }: { data: any }) => { >
- {channel.name} - {channel.about} + {channel?.name} + {channel?.about}