import Foundation import Models import Utils import Views struct WebReaderContent { let textFontSize: Int let lineHeight: Int let maxWidthPercentage: Int let item: LinkedItem let isDark: Bool let themeKey: String let fontFamily: WebFont let articleContent: ArticleContent let prefersHighContrastText: Bool let enableHighlightOnRelease: Bool let justifyText: Bool init( item: LinkedItem, articleContent: ArticleContent, isDark: Bool, fontSize: Int, lineHeight: Int, maxWidthPercentage: Int, fontFamily: WebFont, prefersHighContrastText: Bool, enableHighlightOnRelease: Bool, justifyText: Bool ) { self.textFontSize = fontSize self.lineHeight = lineHeight self.maxWidthPercentage = maxWidthPercentage self.item = item self.isDark = isDark self.themeKey = ThemeManager.currentTheme.themeKey self.fontFamily = fontFamily self.articleContent = articleContent self.prefersHighContrastText = prefersHighContrastText self.enableHighlightOnRelease = enableHighlightOnRelease self.justifyText = justifyText } // 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 """
""" } // swiftlint:disable line_length function_body_length static func emptyContent(isDark: Bool) -> String { let themeKey = ThemeManager.currentTheme.themeKey return """ """ } }