index.tsx raw
1 import ProfileList from '@/components/ProfileList'
2 import { useFetchFollowings, useFetchProfile } from '@/hooks'
3 import SecondaryPageLayout from '@/layouts/SecondaryPageLayout'
4 import { forwardRef } from 'react'
5 import { useTranslation } from 'react-i18next'
6
7 const FollowingListPage = forwardRef(({ id, index }: { id?: string; index?: number }, ref) => {
8 const { t } = useTranslation()
9 const { profile } = useFetchProfile(id)
10 const { followings } = useFetchFollowings(profile?.pubkey)
11
12 return (
13 <SecondaryPageLayout
14 ref={ref}
15 index={index}
16 title={
17 profile?.username
18 ? t("username's following", { username: profile.username })
19 : t('Following')
20 }
21 displayScrollToTopButton
22 >
23 <ProfileList pubkeys={followings} />
24 </SecondaryPageLayout>
25 )
26 })
27 FollowingListPage.displayName = 'FollowingListPage'
28 export default FollowingListPage
29