import React from 'react';
import { useTranslation } from 'react-i18next';
import { useMatrixClient } from '../../../hooks/useMatrixClient';
import { SettingsPage } from '../SettingsPage';
import { ProxyForm } from './ProxyForm';

type NetworkProps = {
  requestClose: () => void;
};

export function Network({ requestClose }: NetworkProps) {
  const { t } = useTranslation();
  const mx = useMatrixClient();
  return (
    <SettingsPage title={t('Settings.network.title')} requestClose={requestClose}>
      <ProxyForm homeserverBaseUrl={mx.baseUrl} />
    </SettingsPage>
  );
}
