// import formatTrendValue from utils import { formatTrendValue } from './utils'; export default function AnalysisTrend( props: AnalysisTrendProps ) { let { value, notation = 'compact', direction = 'neutral', value2 = null, notation2 = null, direction2 = 'neutral', relation = 'scale', } = props; if ( notation2 === null ) { notation2 = notation; } let prefix = ''; if ( direction === 'up' ) { prefix = '+'; } if ( direction === 'down' ) { prefix = '-'; } const formattedValue = `${ prefix }${ formatTrendValue( value, notation ) }`; let formattedValue2: string | null = null; if ( value2 !== null ) { let prefix2 = ''; if ( direction2 === 'up' ) { prefix2 = '+'; } if ( direction2 === 'down' ) { prefix2 = '-'; } formattedValue2 = `${ prefix2 }${ formatTrendValue( value2, notation2 ) }`; if ( relation === 'parenthesis' ) { formattedValue2 = `(${ formattedValue2 })`; } } const isValuesTheSame = value === value2 && direction === direction2 && notation === notation2; return ( { formattedValue } { direction === 'up' && ( ) } { direction === 'down' && ( ) } { value2 !== null && ! isValuesTheSame && relation === 'scale' && ( - ) } { value2 !== null && ! isValuesTheSame && ( { formattedValue2 } ) } ); }