import Foundation import Models import Utils import Views struct WebReaderContent { let textFontSize: Int let lineHeight: Int let margin: Int let htmlContent: String let highlightsJSONString: String let item: LinkedItem let themeKey: String let fontFamily: WebFont init( htmlContent: String, highlightsJSONString: String, item: LinkedItem, isDark: Bool, fontSize: Int, lineHeight: Int, margin: Int, fontFamily: WebFont ) { self.textFontSize = fontSize self.lineHeight = lineHeight self.margin = margin self.htmlContent = htmlContent self.highlightsJSONString = highlightsJSONString self.item = item self.themeKey = isDark ? "Gray" : "LightGray" self.fontFamily = fontFamily } // swiftlint:disable line_length var styledContent: String { let savedAt = "new Date(\(item.unwrappedSavedAt.timeIntervalSince1970 * 1000)).toISOString()" let createdAt = "new Date(\(item.unwrappedCreatedAt.timeIntervalSince1970 * 1000)).toISOString()" let publishedAt = item.publishDate != nil ? "new Date(\(item.publishDate!.timeIntervalSince1970 * 1000)).toISOString()" : "undefined" return """
""" } }