import React from 'react' ; import type { Option } from 'react-select' ; import Select from 'react-select' ; import { CheckboxInput , StageConfigField } from '@spinnaker/core' ; export interface IPatchManifestOptionsFormProps { record : boolean ; onRecordChange : ( record : boolean ) => void ; strategy : string ; onStrategyChange : ( strategy : string ) => void ; } export const PatchManifestOptionsForm = ( props ) => { return ( < div className = "form-horizontal" > < StageConfigField label = "Record Patch Annotation" helpKey = "kubernetes.manifest.patch.record" > < CheckboxInput checked = { props . record } onChange = { ( e ) => props . onRecordChange ( e . target . checked ) } /> < /StageConfigField> < StageConfigField label = "Merge Strategy" helpKey = "kubernetes.manifest.patch.mergeStrategy" fieldColumns = { 3 } > < Select clearable = { false } value = { props . strategy } options = { [ 'strategic' , 'json' , 'merge' ] . map ( ( k ) => ( { value : k , label : k } ) ) } onChange = { ( e ) => props . onStrategyChange ( e . value ) } /> < /StageConfigField> < /div>); } ;