//
//  TimelineItem.swift
//  NetNewsWire
//
//  Created by Maurice Parker on 6/30/20.
//  Copyright © 2020 Ranchero Software. All rights reserved.
//

import SwiftUI
import Articles

enum TimelineItemStatus {
	case showStar
	case showUnread
	case showNone
}

struct TimelineItem: Identifiable {
	
	var article: Article
	
	var id: String {
		return article.articleID
	}
	
	var status:  TimelineItemStatus {
		if article.status.starred == true {
			return .showStar
		}
		if article.status.read == false {
			return .showUnread
		}
		return .showNone
	}
	
	var byline: String {
		return article.webFeed?.nameForDisplay ?? ""
	}
	
	var dateTimeString: String {
		return ArticleStringFormatter.dateString(article.logicalDatePublished)
	}
	
}

//
//  TimelineItem.swift
//  NetNewsWire
//
//  Created by Maurice Parker on 6/30/20.
//  Copyright © 2020 Ranchero Software. All rights reserved.
//

import SwiftUI
import Articles

enum TimelineItemStatus {
	case showStar
	case showUnread
	case showNone
}

struct TimelineItem: Identifiable {
	
	var article: Article
	
	var id: String {
		return article.articleID
	}
	
	var status:  TimelineItemStatus {
		if article.status.starred == true {
			return .showStar
		}
		if article.status.read == false {
			return .showUnread
		}
		return .showNone
	}
	
	var byline: String {
		return article.byline()
	}
	
	var dateTimeString: String {
		return ArticleStringFormatter.dateString(article.logicalDatePublished)
	}
	
}

--- 
+++ 
@@ -34,7 +34,7 @@
 	}
 	
 	var byline: String {
-		return article.byline()
+		return article.webFeed?.nameForDisplay ?? ""
 	}
 	
 	var dateTimeString: String {
Change the timeline byline to be the webbed for now
