dev: automated commit - 2025-06-17 16:15:21
This commit is contained in:
parent
73e91db78b
commit
27775e6b29
16 changed files with 1860 additions and 1240 deletions
34
templates/alert.templ
Normal file
34
templates/alert.templ
Normal file
|
@ -0,0 +1,34 @@
|
|||
|
||||
package templates
|
||||
|
||||
templ Alert(id, alertType, message string, dismissible bool) {
|
||||
<div
|
||||
id={ id }
|
||||
class={ "alert", "alert-" + alertType, templ.KV("alert-dismissible", dismissible), templ.KV("d-none", message == "") }
|
||||
role="alert"
|
||||
>
|
||||
if message != "" {
|
||||
{ message }
|
||||
}
|
||||
if dismissible {
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
// Helper components for common alert types
|
||||
templ ErrorAlert(id, message string) {
|
||||
@Alert(id, "danger", message, false)
|
||||
}
|
||||
|
||||
templ SuccessAlert(id, message string) {
|
||||
@Alert(id, "success", message, true)
|
||||
}
|
||||
|
||||
templ WarningAlert(id, message string) {
|
||||
@Alert(id, "warning", message, true)
|
||||
}
|
||||
|
||||
templ InfoAlert(id, message string) {
|
||||
@Alert(id, "info", message, true)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue