import React, { VFC } from 'react'; import { Box, Typography } from '@mui/material'; import type { IChangeRequest } from '../changeRequest.types'; import { FeatureToggleChanges } from './Changes/FeatureToggleChanges'; import { FeatureChange } from './Changes/Change/FeatureChange'; import { ChangeActions } from './Changes/Change/ChangeActions'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import { SegmentChange } from './Changes/Change/SegmentChange'; interface IChangeRequestProps { changeRequest: IChangeRequest; onRefetch?: () => void; onNavigate?: () => void; } export const ChangeRequest: VFC = ({ changeRequest, onRefetch, onNavigate, }) => { return ( 0} show={ You request changes for these segments: } /> {changeRequest.segments?.map((segmentChange) => ( } /> ))} 0} show={ You request changes for these feature toggles: } /> {changeRequest.features?.map((feature) => ( {feature.changes.map((change, index) => ( key={index} actions={ } index={index} changeRequest={changeRequest} change={change} feature={feature} onNavigate={onNavigate} /> ))} {feature.defaultChange ? ( {feature.defaultChange.action === 'addStrategy' ? 'Default strategy will be added' : 'Feature status will change'} } index={feature.changes.length} changeRequest={changeRequest} change={feature.defaultChange} feature={feature} /> ) : null} ))} ); };