26 lines
638 B
Swift
26 lines
638 B
Swift
import Elementary
|
|
import ElementaryHTMX
|
|
import SharedModels
|
|
|
|
struct VendorDetail: HTML, Sendable {
|
|
|
|
let vendor: Vendor
|
|
|
|
var content: some HTML {
|
|
Float(shouldDisplay: true) {
|
|
VendorForm(.formOnly(vendor))
|
|
h2(.style("margin-left: 20px; font-size: 1.5em;"), .class("label")) { "Branches" }
|
|
VendorBranchForm(vendorID: vendor.id)
|
|
VendorBranchList(vendorID: vendor.id, branches: nil)
|
|
} closeButton: {
|
|
Button.close(id: "float")
|
|
.attributes(
|
|
.hx.get(route: .vendor(.index)),
|
|
.hx.pushURL(true),
|
|
.hx.target(.body),
|
|
.hx.swap(.outerHTML)
|
|
)
|
|
}
|
|
}
|
|
}
|