package pages import ( "fmt" "git.hafen.run/lukas/timeshare/components/button" "git.hafen.run/lukas/timeshare/components/label" "git.hafen.run/lukas/timeshare/components/radio" "git.hafen.run/lukas/timeshare/components/toast" ) type Expiry struct { DurationCode string DurationName string } templ Upload(expirations []Expiry, uploadedLink string) { @PageSkeleton("Upload - Time Share") { if uploadedLink != "" { @toast.Toast(toast.Props{ Title: "Share Created!", Description: fmt.Sprintf(`%s`, uploadedLink, uploadedLink), Variant: toast.VariantSuccess, Duration: 120000, // 2 min Position: toast.PositionBottomCenter, Dismissible: true, Icon: true, }) }

Time Share Upload

Drop files onto here or click to upload

Expiration:

for i, expiry := range expirations {
@radio.Radio(radio.Props{ ID: expiry.DurationCode, Name: "expiry", Value: expiry.DurationCode, Checked: i == 0, }) @label.Label(label.Props{ For: expiry.DurationCode, }) { { expiry.DurationName } }
}
@button.Button(button.Props{ Type: "submit", }) { Upload }
} }