feat: Moves vendor branch views to their own files, starts to implement snapshot testing for html

This commit is contained in:
2025-01-21 09:51:11 -05:00
parent 40726c8bd7
commit 97b231767e
15 changed files with 231 additions and 71 deletions

View File

@@ -1,4 +1,6 @@
import Elementary
import SharedModels
import URLRouting
struct ToggleFormButton: HTML {
var content: some HTML<HTMLTag.a> {
@@ -24,6 +26,13 @@ enum Button {
}
}
static func close(id: IDKey, resetURL route: ViewRoute? = nil) -> some HTML<HTMLTag.button> {
close(
id: id.description,
resetURL: route != nil ? ViewRoute.router.path(for: route!) : nil
)
}
static func update() -> some HTML<HTMLTag.button> {
button(.class("btn-update")) { "Update" }
}

View File

@@ -10,4 +10,9 @@ enum Img {
static func search(width: Int = 30, height: Int = 30) -> some HTML<HTMLTag.img> {
img(.src("/images/search.svg"), .width(width), .height(height))
}
@Sendable
static func trashCan(width: Int = 30, height: Int = 30) -> some HTML<HTMLTag.img> {
img(.src("/images/trash-can.svg"), .width(width), .height(height))
}
}