import { memo, RefObject, useRef, useState } from 'react'; import { setAccount, useAccount, usePlebbitRpcSettings } from '@bitsocialhq/bitsocial-react-hooks'; import { useTranslation } from 'react-i18next'; import styles from './advanced-settings.module.css'; interface SettingsProps { ipfsGatewayUrlsRef?: RefObject; mediaIpfsGatewayUrlRef?: RefObject; pubsubProvidersRef?: RefObject; httpRoutersRef?: RefObject; ethRpcRef?: RefObject; solRpcRef?: RefObject; p2pRpcRef?: RefObject; p2pDataPathRef?: RefObject; } const IPFSGatewaysSettings = ({ ipfsGatewayUrlsRef, mediaIpfsGatewayUrlRef }: SettingsProps) => { const account = useAccount(); const { plebbitOptions, mediaIpfsGatewayUrl } = account || {}; const { ipfsGatewayUrls } = plebbitOptions || {}; const plebbitRpc = usePlebbitRpcSettings(); const isConnectedToRpc = plebbitRpc?.state === 'connected'; const ipfsGatewayUrlsDefaultValue = ipfsGatewayUrls?.join('\n'); return (