feat: Mostly working user view with elementary html.
This commit is contained in:
27
Sources/App/Views/Float.swift
Normal file
27
Sources/App/Views/Float.swift
Normal file
@@ -0,0 +1,27 @@
|
||||
import Elementary
|
||||
|
||||
struct Float<C: HTML>: HTML {
|
||||
|
||||
let id: String
|
||||
let body: C?
|
||||
|
||||
init(id: String = "float") {
|
||||
self.id = id
|
||||
self.body = nil
|
||||
}
|
||||
|
||||
init(id: String = "float", @HTMLBuilder body: () -> C) {
|
||||
self.id = id
|
||||
self.body = body()
|
||||
}
|
||||
|
||||
var content: some HTML {
|
||||
div(.id(id), .class("float")) {
|
||||
if let body {
|
||||
body
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension Float: Sendable where C: Sendable {}
|
||||
Reference in New Issue
Block a user