feat: Initial filter pressure drop views, calculations need implemented.
This commit is contained in:
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user