File size: 19,158 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
import {
	Button,
	FormInputValidation,
	FormLabel,
	Gridicon,
	SegmentedControl,
} from '@automattic/components';
import { useTranslate } from 'i18n-calypso';
import { FunctionComponent, useState, FormEventHandler } from 'react';
import FormInputCheckbox from 'calypso/components/forms/form-checkbox';
import FormFieldset from 'calypso/components/forms/form-fieldset';
import FormPasswordInput from 'calypso/components/forms/form-password-input';
import FormSelect from 'calypso/components/forms/form-select';
import FormSettingExplanation from 'calypso/components/forms/form-setting-explanation';
import FormTextInput from 'calypso/components/forms/form-text-input';
import FormTextArea from 'calypso/components/forms/form-textarea';
import InfoPopover from 'calypso/components/info-popover';
import { useDispatch } from 'calypso/state';
import { recordTracksEvent } from 'calypso/state/analytics/actions';
import { FormState, FormMode, FormErrors, INITIAL_FORM_INTERACTION } from '../form';
import { getHostInfoFromId } from '../host-info';
import InlineInfo from './inline-info';
import './style.scss';

interface Props {
	formErrors: FormErrors;
	formMode: FormMode;
	formModeSwitcher?: 'segmented' | 'simple';
	disabled?: boolean;
	formState: FormState;
	onFormStateChange: ( newFormState: FormState ) => void;
	onModeChange: ( fromMode: FormMode ) => void;
	host: string;
	role: string;
	withHeader?: boolean;
	children?: React.ReactNode;
	allowFtp?: boolean;
}

const ServerCredentialsForm: FunctionComponent< Props > = ( {
	children,
	disabled = false,
	formState,
	formErrors,
	formMode,
	formModeSwitcher = 'segmented',
	onFormStateChange,
	onModeChange,
	host,
	role = 'main',
	withHeader = true,
	allowFtp = true,
} ) => {
	const translate = useTranslate();
	const dispatch = useDispatch();
	const [ interactions, setFormInteractions ] = useState( INITIAL_FORM_INTERACTION );
	const hostInfo = getHostInfoFromId( host );
	const isAlternate = role === 'alternate';
	formState.role = role;

	const handleFormChange: FormEventHandler< HTMLInputElement | HTMLSelectElement > = ( {
		currentTarget,
	} ) => {
		switch ( currentTarget.name ) {
			case 'protocol':
				onFormStateChange( {
					...formState,
					protocol: currentTarget.value as 'ftp' | 'ssh' | 'dynamic-ssh',
					port: ( () => {
						let port = parseInt( String( formState.port ) ) || 22;

						if ( formState.port === 22 && currentTarget.value === 'ftp' ) {
							port = 21;
						} else if ( formState.port === 21 && currentTarget.value === 'ssh' ) {
							port = 22;
						}

						return port;
					} )(),
				} );
				onModeChange( FormMode.Password );
				break;
			case 'host':
				setFormInteractions( { ...interactions, host: true } );
				onFormStateChange( { ...formState, host: currentTarget.value } );
				break;
			case 'site_url':
				setFormInteractions( { ...interactions, site_url: true } );
				onFormStateChange( { ...formState, site_url: currentTarget.value } );
				break;
			case 'port':
				setFormInteractions( { ...interactions, port: true } );
				onFormStateChange( {
					...formState,
					port: isNaN( parseInt( currentTarget.value ) ) ? '' : parseInt( currentTarget.value ),
				} );
				break;
			case 'user':
				setFormInteractions( { ...interactions, user: true } );
				onFormStateChange( { ...formState, user: currentTarget.value } );
				break;
			case 'pass':
				setFormInteractions( { ...interactions, pass: true } );
				onFormStateChange( { ...formState, pass: currentTarget.value } );
				break;
			case 'path':
				setFormInteractions( { ...interactions, path: true } );
				onFormStateChange( { ...formState, path: currentTarget.value } );
				break;
			case 'kpri':
				setFormInteractions( { ...interactions, kpri: true } );
				onFormStateChange( { ...formState, kpri: currentTarget.value } );
				break;
			case 'save_as_staging':
				setFormInteractions( { ...interactions, save_as_staging: true } );
				onFormStateChange( {
					...formState,
					save_as_staging: ( currentTarget as HTMLInputElement ).checked,
				} );
				break;
		}
	};

	const renderServerUsernameForm = () => (
		<FormFieldset className="credentials-form__username">
			<div className="credentials-form__support-info">
				<FormLabel htmlFor="server-username">{ translate( 'Username' ) }</FormLabel>
				{ hostInfo?.inline?.user && (
					<InfoPopover>
						<InlineInfo
							field="user"
							host={ host }
							info={ hostInfo.inline.user }
							protocol={ formState.protocol }
						/>
					</InfoPopover>
				) }
			</div>
			<FormTextInput
				name="user"
				id="server-username"
				placeholder={ translate( 'username' ) }
				value={ formState.user }
				onChange={ handleFormChange }
				disabled={ disabled }
				isError={ formErrors.user && ( interactions.user || ! formErrors.user.waitForInteraction ) }
				// Hint to LastPass not to attempt autofill
				data-lpignore="true"
			/>
			{ formErrors.user && ( interactions.user || ! formErrors.user.waitForInteraction ) && (
				<FormInputValidation isError text={ formErrors.user.message } />
			) }
		</FormFieldset>
	);

	const renderPasswordForm = () => (
		<div className="credentials-form__row credentials-form__user-pass">
			{ renderServerUsernameForm() }
			<FormFieldset className="credentials-form__password">
				<div className="credentials-form__support-info">
					<FormLabel htmlFor="server-password">{ translate( 'Password' ) }</FormLabel>
					{ hostInfo?.inline?.pass && (
						<InfoPopover>
							<InlineInfo
								field="pass"
								host={ host }
								info={ hostInfo.inline.pass }
								protocol={ formState.protocol }
							/>
						</InfoPopover>
					) }
				</div>
				<FormPasswordInput
					name="pass"
					id="server-password"
					placeholder={ translate( 'password' ) }
					value={ formState.pass }
					onChange={ handleFormChange }
					disabled={ disabled }
					isError={
						formErrors.pass && ( interactions.pass || ! formErrors.pass.waitForInteraction )
					}
					// Hint to LastPass not to attempt autofill
					data-lpignore="true"
				/>
				{ formErrors.pass && ( interactions.pass || ! formErrors.pass.waitForInteraction ) && (
					<FormInputValidation isError text={ formErrors.pass.message } />
				) }
			</FormFieldset>
		</div>
	);

	const renderPrivateKeyForm = () => (
		<>
			{ renderServerUsernameForm() }
			<FormFieldset className="credentials-form__kpri">
				<div className="credentials-form__support-info">
					<FormLabel htmlFor="private-key">{ translate( 'Private key' ) }</FormLabel>
					{ hostInfo?.inline?.kpri && (
						<InfoPopover>
							<InlineInfo
								field="kpri"
								host={ host }
								info={ hostInfo.inline.kpri }
								protocol={ formState.protocol }
							/>
						</InfoPopover>
					) }
				</div>
				<FormTextArea
					name="kpri"
					id="private-key"
					value={ formState.kpri }
					onChange={ handleFormChange }
					disabled={ disabled }
					className="credentials-form__private-key"
					isError={
						formErrors.kpri && ( interactions.kpri || ! formErrors.kpri.waitForInteraction )
					}
				/>
				{ formModeSwitcher === 'segmented' && (
					<FormSettingExplanation>
						{ translate( 'Only non-encrypted private keys are supported.' ) }
					</FormSettingExplanation>
				) }
				{ formErrors.kpri && ( interactions.kpri || ! formErrors.kpri.waitForInteraction ) && (
					<FormInputValidation isError text={ formErrors.kpri.message } />
				) }
			</FormFieldset>
		</>
	);

	const getSubHeaderText = () => {
		if ( isAlternate && hostInfo !== null && hostInfo.supportLink !== undefined ) {
			return translate(
				'Enter the server credentials from your hosting provider. {{a}}Learn how to find and enter your credentials{{/a}}',
				{
					components: {
						a: (
							<a
								target="_blank"
								rel="noopener noreferrer"
								href={ hostInfo.supportLink }
								onClick={ () =>
									dispatch(
										recordTracksEvent(
											'calypso_jetpack_advanced_credentials_flow_support_link_click',
											{ host }
										)
									)
								}
							/>
						),
					},
				}
			);
		} else if ( hostInfo !== null && hostInfo.inline !== undefined ) {
			return translate( 'Check the information icons for details on %(hostName)s', {
				args: {
					hostName: hostInfo?.name,
				},
			} );
		} else if ( hostInfo !== null && hostInfo.supportLink !== undefined ) {
			return 'generic' === host
				? translate(
						'Read through {{a}}our support site{{/a}} to learn how to obtain your credentials.',
						{
							components: {
								a: (
									<a
										target="_blank"
										rel="noopener noreferrer"
										href={ hostInfo.supportLink }
										onClick={ () =>
											dispatch(
												recordTracksEvent(
													'calypso_jetpack_advanced_credentials_flow_support_link_click',
													{ host }
												)
											)
										}
									/>
								),
							},
						}
				  )
				: translate(
						'Read through the {{a}}%(hostName)s support site{{/a}} to learn how to obtain your credentials.',
						{
							args: {
								hostName: hostInfo.name,
							},
							components: {
								a: (
									<a
										target="_blank"
										rel="noopener noreferrer"
										href={ hostInfo.supportLink }
										onClick={ () =>
											dispatch(
												recordTracksEvent(
													'calypso_jetpack_advanced_credentials_flow_support_link_click',
													{ host }
												)
											)
										}
									/>
								),
							},
						}
				  );
		}
		return translate( 'Your hosting provider will be able to supply this information to you.' );
	};

	const getFormHeaderText = () => {
		if ( ! allowFtp ) {
			return translate( 'Provide your SSH, SFTP server credentials' );
		}
		return translate( 'Provide your SSH, SFTP or FTP server credentials' );
	};

	const renderCredentialLinks = () => {
		if ( hostInfo !== null && hostInfo.credentialLinks !== undefined ) {
			if ( 'ftp' === formState.protocol && hostInfo.credentialLinks.ftp !== undefined ) {
				return (
					<Button
						className="credentials-form__credentials-guide-link"
						href={ hostInfo.credentialLinks.ftp }
						target="_blank"
						onClick={ () =>
							dispatch(
								recordTracksEvent(
									'calypso_jetpack_advanced_credentials_flow_credentials_guide_click',
									{
										host,
									}
								)
							)
						}
					>
						{ translate( 'Read the %(hostName)s credentials guide', {
							args: {
								hostName: hostInfo.name,
							},
						} ) }
						<Gridicon icon="external" />
					</Button>
				);
			}
			if ( 'ssh' === formState.protocol && hostInfo.credentialLinks.sftp !== undefined ) {
				return (
					<Button
						className="credentials-form__credentials-guide-link"
						href={ hostInfo.credentialLinks.sftp }
						target="_blank"
						onClick={ () =>
							dispatch(
								recordTracksEvent(
									'calypso_jetpack_advanced_credentials_flow_credentials_guide_click',
									{
										host,
									}
								)
							)
						}
					>
						{ translate( 'Read the %(hostName)s credentials guide', {
							args: {
								hostName: hostInfo.name,
							},
						} ) }
						<Gridicon icon="external" />
					</Button>
				);
			}
		}
		return null;
	};

	return (
		<div className="credentials-form">
			{ isAlternate && (
				<FormFieldset className="credentials-form__site-url">
					<div className="credentials-form__support-info">
						<FormLabel htmlFor="destination-url">{ translate( 'Destination URL' ) }</FormLabel>
					</div>
					<FormTextInput
						name="site_url"
						id="site-url"
						placeholder="https://example.com/"
						value={ formState.site_url }
						onChange={ handleFormChange }
						disabled={ disabled }
						isError={
							formErrors.site_url &&
							( interactions.site_url || ! formErrors.site_url.waitForInteraction )
						}
					/>
					{ formErrors.site_url &&
						( interactions.site_url || ! formErrors.site_url.waitForInteraction ) && (
							<FormInputValidation isError text={ formErrors.site_url.message } />
						) }
				</FormFieldset>
			) }
			{ ! isAlternate && withHeader && <h3>{ getFormHeaderText() }</h3> }
			{ withHeader && <p className="credentials-form__intro-text">{ getSubHeaderText() }</p> }
			{ withHeader && renderCredentialLinks() }
			{ ! allowFtp && <input type="hidden" name="protocol" value="ssh" /> }
			{ allowFtp && (
				<FormFieldset className="credentials-form__protocol-type">
					<div className="credentials-form__support-info">
						<FormLabel htmlFor="protocol-type">{ translate( 'Credential type' ) }</FormLabel>
						{ hostInfo?.inline?.protocol && (
							<InfoPopover>
								<InlineInfo
									field="protocol"
									host={ host }
									info={ hostInfo.inline.protocol }
									protocol={ formState.protocol }
								/>
							</InfoPopover>
						) }
					</div>
					<FormSelect
						name="protocol"
						id="protocol-type"
						value={ formState.protocol }
						onChange={ handleFormChange }
						disabled={ disabled }
					>
						<option value="ftp">{ translate( 'FTP' ) }</option>
						<option value="ssh">{ translate( 'SSH/SFTP' ) }</option>
					</FormSelect>
				</FormFieldset>
			) }
			<div className="credentials-form__row">
				<FormFieldset className="credentials-form__server-address">
					<div className="credentials-form__support-info">
						<FormLabel htmlFor="host-address">{ translate( 'Server address' ) }</FormLabel>
						{ hostInfo?.inline?.host && (
							<InfoPopover>
								<InlineInfo
									field="host"
									host={ host }
									info={ hostInfo.inline.host }
									protocol={ formState.protocol }
								/>
							</InfoPopover>
						) }
					</div>
					<FormTextInput
						name="host"
						id="host-address"
						placeholder={ translate( 'example.com' ) }
						value={ formState.host }
						onChange={ handleFormChange }
						disabled={ disabled }
						isError={
							formErrors.host && ( interactions.host || ! formErrors.host.waitForInteraction )
						}
					/>
					{ formErrors.host && ( interactions.host || ! formErrors.host.waitForInteraction ) && (
						<FormInputValidation isError text={ formErrors.host.message } />
					) }
				</FormFieldset>

				<FormFieldset className="credentials-form__port-number">
					<div className="credentials-form__support-info">
						<FormLabel htmlFor="server-port">{ translate( 'Port number' ) }</FormLabel>
						{ hostInfo?.inline?.port && (
							<InfoPopover>
								<InlineInfo
									field="port"
									host={ host }
									info={ hostInfo.inline.port }
									protocol={ formState.protocol }
								/>
							</InfoPopover>
						) }
					</div>
					<FormTextInput
						name="port"
						id="server-port"
						placeholder="22"
						value={ formState.port }
						onChange={ handleFormChange }
						disabled={ disabled }
						isError={
							formErrors.port && ( interactions.port || ! formErrors.port.waitForInteraction )
						}
					/>
					{ formErrors.port && ( interactions.port || ! formErrors.port.waitForInteraction ) && (
						<FormInputValidation isError text={ formErrors.port.message } />
					) }
				</FormFieldset>
			</div>
			<FormFieldset className="credentials-form__path">
				<div className="credentials-form__support-info">
					<FormLabel htmlFor="wordpress-path">
						{ translate( 'WordPress installation path' ) }
					</FormLabel>
					{ hostInfo?.inline?.path && (
						<InfoPopover>
							<InlineInfo
								field="path"
								host={ host }
								info={ hostInfo.inline.path }
								protocol={ formState.protocol }
							/>
						</InfoPopover>
					) }
				</div>
				<FormTextInput
					name="path"
					id="wordpress-path"
					placeholder="/public_html/wordpress-site/"
					value={ formState.path }
					onChange={ handleFormChange }
					disabled={ disabled }
					isError={
						formErrors.path && ( interactions.path || ! formErrors.path.waitForInteraction )
					}
				/>
				{ formErrors.path && ( interactions.path || ! formErrors.path.waitForInteraction ) && (
					<FormInputValidation isError text={ formErrors.path.message } />
				) }
			</FormFieldset>
			{ formModeSwitcher === 'segmented' && 'ftp' !== formState.protocol && (
				<div className="credentials-form__mode-control">
					<div className="credentials-form__support-info">
						<SegmentedControl disabled={ disabled }>
							<SegmentedControl.Item
								selected={ formMode === FormMode.Password }
								onClick={ () => onModeChange( FormMode.Password ) }
							>
								{ translate( 'Use password' ) }
							</SegmentedControl.Item>
							<SegmentedControl.Item
								selected={ formMode === FormMode.PrivateKey }
								onClick={ () => onModeChange( FormMode.PrivateKey ) }
							>
								{ translate( 'Use private key' ) }
							</SegmentedControl.Item>
						</SegmentedControl>
						{ hostInfo?.inline?.mode && (
							<InfoPopover>
								<InlineInfo
									field="mode"
									host={ host }
									info={ hostInfo.inline.mode }
									protocol={ formState.protocol }
								/>
							</InfoPopover>
						) }
					</div>
				</div>
			) }
			{ formModeSwitcher === 'simple' && (
				<FormFieldset>
					<FormLabel>{ translate( 'SSH credentials' ) }</FormLabel>
					<FormSettingExplanation>
						{ translate(
							'Your credentials will be used only to migrate the site and won’t be stored anywhere.'
						) }
					</FormSettingExplanation>
				</FormFieldset>
			) }
			{ formMode === FormMode.Password ? renderPasswordForm() : renderPrivateKeyForm() }
			{ formModeSwitcher === 'simple' && (
				<>
					{ formMode === FormMode.Password && (
						<p>
							<Button plain onClick={ () => onModeChange( FormMode.PrivateKey ) }>
								{ translate( 'Use private key instead' ) }
							</Button>
						</p>
					) }
					{ formMode === FormMode.PrivateKey && (
						<p>
							<span>{ translate( 'Only non-encrypted private keys are supported.' ) }</span>{ ' ' }
							<Button plain onClick={ () => onModeChange( FormMode.Password ) }>
								{ translate( 'Use a password instead' ) }
							</Button>
						</p>
					) }
				</>
			) }
			{ isAlternate && (
				<FormFieldset className="credentials-form__save-for-later">
					<FormLabel htmlFor="save-for-later">
						<FormInputCheckbox
							checked={ formState.save_as_staging }
							id="save-for-later"
							name="save_as_staging"
							onChange={ handleFormChange }
							value="true"
						/>
						<span>
							{ translate( 'Remember credentials' ) }
							<InfoPopover
								className="credentials-form__remember-credentials-info-popover"
								position="right"
								showOnHover
							>
								{ translate(
									'Save this configuration so you can easily access it the next time you copy a site to staging.'
								) }
							</InfoPopover>
						</span>
					</FormLabel>
				</FormFieldset>
			) }
			<FormFieldset className="credentials-form__buttons">
				<div className="credentials-form__buttons-flex">{ children }</div>
			</FormFieldset>
		</div>
	);
};

export default ServerCredentialsForm;