import * as m from 'mithril' ; import state from '../state/state' ; interface DocumentHeaderAttributes { documentName : string ; hasUnsavedChanges : boolean ; } returns function DocumentHeader ( ) { return { view : ( { attrs } ) : m . Vnode => { const docName = attrs . documentName === '' ? 'New Map' : attrs . documentName ; const modifiedIndicator = attrs . hasUnsavedChanges ? ' (Modified)' : '' ; return m ( 'div' , { style : `font-size: ${ state . ui . getCurrentFontSize ( ) }px` } , docName , m ( 'span' , { style : 'color: blue' } , modifiedIndicator ) ) ; } , } ; } export default DocumentHeader ;