Rework content commands, add audio player
This commit is contained in:
@ -0,0 +1,28 @@
|
||||
|
||||
struct ContentLabel {
|
||||
|
||||
let icon: PageIcon
|
||||
|
||||
let value: String
|
||||
}
|
||||
|
||||
struct ContentLabels {
|
||||
|
||||
private let labels: [ContentLabel]
|
||||
|
||||
init(labels: [ContentLabel]) {
|
||||
self.labels = labels
|
||||
}
|
||||
|
||||
var content: String {
|
||||
guard !labels.isEmpty else {
|
||||
return ""
|
||||
}
|
||||
var result = "<div class='labels-container'>"
|
||||
for label in labels {
|
||||
result += "<div><svg><use href='#\(label.icon.icon.name)'></use></svg>\(label.value)</div>"
|
||||
}
|
||||
result += "</div>"
|
||||
return result
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user