import React, { useState } from 'react'; import PropTypes from 'prop-types'; import { ToggleGroup, ToggleGroupItem, } from '@patternfly/react-core'; import { noop } from 'foremanReact/common/helpers'; import CdnTypeForm from './CdnTypeForm'; import ExportSyncForm from './ExportSyncForm'; import NetworkSyncForm from './NetworkSyncForm'; import './CdnConfigurationForm.scss'; import { CDN_URL, CDN, EXPORT_SYNC, NETWORK_SYNC, CDN_CONFIGURATION_TYPES } from './CdnConfigurationConstants'; const CdnConfigurationForm = (props) => { const { contentCredentials, cdnConfiguration, onUpdate, } = props; const [type, setType] = useState(cdnConfiguration.type); const updateType = (connectionType) => { if (type !== connectionType) { setType(connectionType); } }; const cdnUrl = type !== cdnConfiguration.type ? CDN_URL : cdnConfiguration.url; return (