WIP: Style updates for pdf view.
This commit is contained in:
42
Sources/PdfClient/Views/TrunkTable.swift
Normal file
42
Sources/PdfClient/Views/TrunkTable.swift
Normal file
@@ -0,0 +1,42 @@
|
||||
import Elementary
|
||||
import ManualDCore
|
||||
|
||||
struct TrunkTable: HTML, Sendable {
|
||||
public let sizes: DuctSizes
|
||||
public let type: TrunkSize.TrunkType
|
||||
|
||||
var trunks: [DuctSizes.TrunkContainer] {
|
||||
sizes.trunks.filter { $0.type == type }
|
||||
}
|
||||
|
||||
var body: some HTML<HTMLTag.table> {
|
||||
table {
|
||||
thead(.class("bg-green")) {
|
||||
tr {
|
||||
th { "Name" }
|
||||
th { "Dsn CFM" }
|
||||
th { "Round Size" }
|
||||
th { "Velocity" }
|
||||
th { "Final Size" }
|
||||
th { "Flex Size" }
|
||||
th { "Height" }
|
||||
th { "Width" }
|
||||
}
|
||||
}
|
||||
tbody {
|
||||
for row in trunks {
|
||||
tr {
|
||||
td { row.name ?? "" }
|
||||
td { row.designCFM.value.string(digits: 0) }
|
||||
td { row.ductSize.roundSize.string() }
|
||||
td { row.velocity.string() }
|
||||
td { row.finalSize.string() }
|
||||
td { row.flexSize.string() }
|
||||
td { row.ductSize.height?.string() ?? "" }
|
||||
td { row.width?.string() ?? "" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user