feat: Initial filter pressure drop views, calculations need implemented.

This commit is contained in:
2025-03-02 21:51:52 -05:00
parent a8022ec80a
commit 67488e06a9
17 changed files with 610 additions and 97 deletions

View File

@@ -17,42 +17,16 @@ struct CapacitorForm: HTML, Sendable {
div(.class("flex flex-wrap justify-between")) {
FormHeader(label: "Capacitor Calculator - \(mode.rawValue.capitalized) Capacitor", svg: .zap)
// Mode toggle / buttons.
div(.class("flex items-center gap-x-0")) {
switch mode {
case .test:
SecondaryButton(label: "Test Capacitor")
.attributes(.class("rounded-s-lg"))
.attributes(.disabled, when: mode == .test)
.attributes(
.hx.get(route: .capacitor(.index(mode: .test))),
.hx.target("#content"),
when: mode == .size
)
PrimaryButton(label: "Size Capacitor")
.attributes(.class("rounded-e-lg"))
.attributes(
.hx.get(route: .capacitor(.index(mode: .size))),
.hx.target("#content"),
when: mode == .test
)
case .size:
PrimaryButton(label: "Test Capacitor")
.attributes(.class("rounded-s-lg"))
.attributes(
.hx.get(route: .capacitor(.index(mode: .test))),
.hx.target("#content"),
when: mode == .size
)
SecondaryButton(label: "Size Capacitor")
.attributes(.class("rounded-e-lg"))
.attributes(.disabled, when: mode == .size)
.attributes(
.hx.get(route: .capacitor(.index(mode: .size))),
.hx.target("#content"),
when: mode == .test
)
}
}
// Mode toggle / buttons.
Toggle(
isOn: mode == .test,
onLabel: "Test Capacitor",
onAttributes: .hxDefaults(get: .capacitor(.index(mode: .test))),
offLabel: "Size Capacitor",
offAttributes: .hxDefaults(get: .capacitor(.index(mode: .size)))
)
.attributes(.class("mb-6"))
}
Form(mode: mode).attributes(.class("mt-6"))