import Foundation import Models import Utils struct WebReaderContent { let textFontSize: Int let htmlContent: String let highlightsJSONString: String let item: LinkedItem let themeKey: String init( htmlContent: String, highlightsJSONString: String, item: LinkedItem, isDark: Bool, fontSize: Int ) { self.textFontSize = fontSize self.htmlContent = htmlContent self.highlightsJSONString = highlightsJSONString self.item = item self.themeKey = isDark ? "Gray" : "LightGray" } // 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 """
""" } }