index.tsx raw

   1  import OthersRelayList from '@/components/OthersRelayList'
   2  import { useFetchProfile } from '@/hooks'
   3  import SecondaryPageLayout from '@/layouts/SecondaryPageLayout'
   4  import { forwardRef } from 'react'
   5  import { useTranslation } from 'react-i18next'
   6  
   7  const RelaySettingsPage = forwardRef(({ id, index }: { id?: string; index?: number }, ref) => {
   8    const { t } = useTranslation()
   9    const { profile } = useFetchProfile(id)
  10  
  11    if (!id || !profile) {
  12      return null
  13    }
  14  
  15    return (
  16      <SecondaryPageLayout
  17        ref={ref}
  18        index={index}
  19        title={t("username's used relays", { username: profile.username })}
  20      >
  21        <div className="px-4 pt-3">
  22          <OthersRelayList userId={id} />
  23        </div>
  24      </SecondaryPageLayout>
  25    )
  26  })
  27  RelaySettingsPage.displayName = 'RelaySettingsPage'
  28  export default RelaySettingsPage
  29