feat: Adds page header styles, starts an Alert component.
This commit is contained in:
@@ -42,60 +42,75 @@ struct FrictionRateView: HTML, Sendable {
|
||||
|
||||
var body: some HTML {
|
||||
div(.class("space-y-6")) {
|
||||
div(.class("grid grid-cols-2 px-4")) {
|
||||
PageTitleRow {
|
||||
div(.class("grid grid-cols-2 px-4 gap-y-4")) {
|
||||
|
||||
PageTitle { "Friction Rate" }
|
||||
PageTitle { "Friction Rate" }
|
||||
|
||||
div(.class("space-y-4 justify-end")) {
|
||||
div(.class("space-y-4 justify-end")) {
|
||||
|
||||
if let frictionRateDesignValue {
|
||||
LabeledContent("Friction Rate Design Value") {
|
||||
Badge(number: frictionRateDesignValue, digits: 2)
|
||||
.attributes(.class("\(badgeColor)"))
|
||||
if let frictionRateDesignValue {
|
||||
LabeledContent("Friction Rate Design Value") {
|
||||
Badge(number: frictionRateDesignValue, digits: 2)
|
||||
.attributes(.class("\(badgeColor)"))
|
||||
}
|
||||
.attributes(.class("justify-end"))
|
||||
}
|
||||
|
||||
if let availableStaticPressure {
|
||||
LabeledContent("Available Static Pressure") {
|
||||
Badge(number: availableStaticPressure, digits: 2)
|
||||
}
|
||||
.attributes(.class("justify-end"))
|
||||
}
|
||||
.attributes(.class("justify-end"))
|
||||
}
|
||||
|
||||
if let availableStaticPressure {
|
||||
LabeledContent("Available Static Pressure") {
|
||||
Badge(number: availableStaticPressure, digits: 2)
|
||||
div(.class("text-error font-bold italic col-span-2")) {
|
||||
Alert {
|
||||
p {
|
||||
"Must complete previous sections."
|
||||
}
|
||||
}
|
||||
.attributes(.class("justify-end"))
|
||||
.hidden(
|
||||
when: availableStaticPressure != nil && frictionRateDesignValue != nil
|
||||
)
|
||||
|
||||
Alert {
|
||||
p {
|
||||
"No component pressures losses"
|
||||
}
|
||||
}
|
||||
.hidden(when: componentLosses.totalComponentPressureLoss > 0)
|
||||
|
||||
Alert {
|
||||
p(.class("block")) {
|
||||
"Calculated friction rate is below 0.02. The fan may not deliver the required CFM."
|
||||
br()
|
||||
" * Increase the blower speed"
|
||||
br()
|
||||
" * Increase the blower size"
|
||||
br()
|
||||
" * Decrease the Total Effective Length (TEL)"
|
||||
}
|
||||
}
|
||||
.hidden(when: !showLowErrors)
|
||||
|
||||
Alert {
|
||||
p(.class("block")) {
|
||||
"Calculated friction rate is above 0.18. The fan may deliver too many CFM."
|
||||
br()
|
||||
" * Decrease the blower speed"
|
||||
br()
|
||||
" * Decreae the blower size"
|
||||
br()
|
||||
" * Increase the Total Effective Length (TEL)"
|
||||
}
|
||||
}
|
||||
.hidden(when: !showHighErrors)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
div(.class("text-error italic")) {
|
||||
p {
|
||||
"No component pressures losses"
|
||||
}
|
||||
.attributes(.class("hidden"), when: componentLosses.totalComponentPressureLoss > 0)
|
||||
|
||||
p {
|
||||
"Calculated friction rate is below 0.02. The fan may not deliver the required CFM."
|
||||
br()
|
||||
" * Increase the blower speed"
|
||||
br()
|
||||
" * Increase the blower size"
|
||||
br()
|
||||
" * Decrease the Total Effective Length (TEL)"
|
||||
}
|
||||
.attributes(.class("hidden"), when: !showLowErrors)
|
||||
|
||||
p {
|
||||
"Calculated friction rate is above 0.18. The fan may deliver too many CFM."
|
||||
br()
|
||||
" * Decrease the blower speed"
|
||||
br()
|
||||
" * Decreae the blower size"
|
||||
br()
|
||||
" * Increase the Total Effective Length (TEL)"
|
||||
}
|
||||
.attributes(.class("hidden"), when: !showHighErrors)
|
||||
}
|
||||
|
||||
div(.class("divider")) {}
|
||||
|
||||
ComponentPressureLossesView(
|
||||
componentPressureLosses: componentLosses, projectID: projectID
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user