This repository has been archived on 2026-02-12. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Michael Housh 5440024038
All checks were successful
CI / Linux Tests (push) Successful in 9m34s
feat: Renames EffectiveLength to EquivalentLength
2026-01-29 11:25:20 -05:00

42 lines
1.0 KiB
Swift

import Elementary
import ElementaryHTMX
import ManualDCore
import Styleguide
struct EffectiveLengthsView: HTML, Sendable {
@Environment(ProjectViewValue.$projectID) var projectID
let effectiveLengths: [EquivalentLength]
var supplies: [EquivalentLength] {
effectiveLengths.filter({ $0.type == .supply })
.sorted { $0.totalEquivalentLength > $1.totalEquivalentLength }
}
var returns: [EquivalentLength] {
effectiveLengths.filter({ $0.type == .return })
.sorted { $0.totalEquivalentLength > $1.totalEquivalentLength }
}
var body: some HTML {
div(.class("space-y-4")) {
PageTitleRow {
PageTitle { "Equivalent Lengths" }
PlusButton()
.attributes(
.class("btn-primary"),
.showModal(id: EffectiveLengthForm.id(nil))
)
.tooltip("Add equivalent length")
}
.attributes(.class("pb-6"))
EffectiveLengthForm(projectID: projectID, dismiss: true)
EffectiveLengthsTable(effectiveLengths: effectiveLengths)
}
}
}