import { RefObject, useRef, useState } from 'react'; import { setAccount, useAccount, usePlebbitRpcSettings } from '@plebbit/plebbit-react-hooks'; import { useTranslation } from 'react-i18next'; import styles from './plebbit-options.module.css'; interface SettingsProps { ipfsGatewayUrlsRef?: RefObject; mediaIpfsGatewayUrlRef?: RefObject; pubsubProvidersRef?: RefObject; ethRpcRef?: RefObject; solRpcRef?: RefObject; maticRpcRef?: RefObject; avaxRpcRef?: RefObject; plebbitRpcRef?: RefObject; nodeDataPathRef?: RefObject; } const IPFSGatewaysSettings = ({ ipfsGatewayUrlsRef, mediaIpfsGatewayUrlRef }: SettingsProps) => { const account = useAccount(); const { plebbitOptions, mediaIpfsGatewayUrl } = account || {}; const { ipfsGatewayUrls } = plebbitOptions || {}; const plebbitRpc = usePlebbitRpcSettings(); const isConnectedToRpc = plebbitRpc?.state === 'succeeded'; const ipfsGatewayUrlsDefaultValue = ipfsGatewayUrls?.join('\n'); return (