//import Elementary

struct FeedEntryContent<Content> {

    let url: String?

    let inner: Content

    init(url: String?, inner: Content) {
        self.url = url
        self.inner = inner
    }

    func addContent(to result: inout String, inner: () -> Void) -> Void {
        if let url {
            result += "<div class=\"card-content\" onclick=\"window.location.href='\(url)'\">"
        } else {
            result += "<div class=\"card-content\">"
        }
        inner()
        result += "</div>"
    }
}

/*
extension FeedEntryContent: HTML where Content: HTML {

    init(url: String?, @HTMLBuilder content: () -> Content) {
        self.init(url: url, inner: content())
    }

    var content: some HTML {
        if let url {
            div(.class("card-content"), .on(.click, "window.location.href='\(url)'")) {
                inner
            }
        } else {
            div(.class("card-content")) {
                inner
            }
        }
    }
}
*/
