import { IChangeRequestAddStrategy, IChangeRequestDeleteStrategy, IChangeRequestUpdateStrategy, } from 'component/changeRequest/changeRequest.types'; import { FC } from 'react'; import { formatStrategyName, GetFeatureStrategyIcon, } from 'utils/strategyNames'; import EventDiff from 'component/events/EventDiff/EventDiff'; import omit from 'lodash.omit'; import { TooltipLink } from 'component/common/TooltipLink/TooltipLink'; import { Typography, styled } from '@mui/material'; import { IFeatureStrategy } from 'interfaces/strategy'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import { textTruncated } from 'themes/themeStyles'; const StyledCodeSection = styled('div')(({ theme }) => ({ overflowX: 'auto', '& code': { wordWrap: 'break-word', whiteSpace: 'pre-wrap', fontFamily: 'monospace', lineHeight: 1.5, fontSize: theme.fontSizes.smallBody, }, })); export const StrategyDiff: FC<{ change: | IChangeRequestAddStrategy | IChangeRequestUpdateStrategy | IChangeRequestDeleteStrategy; currentStrategy?: IFeatureStrategy; }> = ({ change, currentStrategy }) => { const changeRequestStrategy = change.action === 'deleteStrategy' ? undefined : change.payload; return ( ); }; interface IStrategyTooltipLinkProps { change: | IChangeRequestAddStrategy | IChangeRequestUpdateStrategy | IChangeRequestDeleteStrategy; previousTitle?: string; } export const StrategyTooltipLink: FC = ({ change, previousTitle, children, }) => ( <> {previousTitle} {' '} } /> {change.payload.title || formatStrategyName(change.payload.name)} );