import { isEmpty } from 'lodash' ; import { ErrorRaw } from '../../../../../../../typings/es_schemas/raw/error_raw' ; import { IWaterfallError } from '../waterfall/waterfall_helpers/waterfall_helpers' ; import { Mark } from '.' ; export interface ErrorMark extends Mark { type : 'errorMark' ; error : ErrorRaw ; serviceColor : string ; } export const getErrorMarks = ( errorItems ) : ErrorMark [ ] => { if ( isEmpty ( errorItems ) ) { return [ ] ; } return errorItems . map ( ( error ) => ( { type : 'errorMark' , offset : Math . max ( error . offset + error . skew , 0 ) , verticalLine : false , id : error . doc . error . id , error : error . doc , serviceColor : error . color , } ) ) ; } ;