import React, { useContext, useEffect } from 'react'; import { Typography, Form } from 'antd'; import TextField, { TEXTFIELD_TYPE_TEXTAREA } from './form-textfield'; import { ServerStatusContext } from '../../../utils/server-status-context'; const { Title } = Typography; export default function PublicFacingDetails() { const [form] = Form.useForm(); const serverStatusData = useContext(ServerStatusContext); const { serverConfig } = serverStatusData || {}; const { instanceDetails = {} } = serverConfig; useEffect(() => { form.setFieldsValue({...instanceDetails}); }, [instanceDetails]); const handleResetValue = (fieldName: string) => { form.setFieldsValue({ [fieldName]: instanceDetails[fieldName]}); } const extraProps = { handleResetValue, initialValues: instanceDetails, }; return ( <>