diff --git a/cmd/main.go b/cmd/main.go index 70db034..bf3e16d 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -24,7 +24,7 @@ func main() { // We redirect the root route to the "/user" route app.GET("/", func(c echo.Context) error { - return c.Redirect(http.StatusMovedPermanently, "/user") + return c.Redirect(http.StatusMovedPermanently, "/landing_page/") }) uStore, err := db.NewUserStore(dbName) diff --git a/handlers/landingpage.handlers.go b/handlers/landingpage.handlers.go index 96253f6..f96eafc 100644 --- a/handlers/landingpage.handlers.go +++ b/handlers/landingpage.handlers.go @@ -13,6 +13,7 @@ import ( type LandingPageService interface { GetClientService() ([]services.ClientService, error) GetClientAdvantage() ([]services.AdvantageClient, error) + GetPromotionList() ([]services.Promotion, error) } func NewLandingPageHandler(us LandingPageService) *LandingPageHandler { @@ -36,8 +37,18 @@ func (uh *LandingPageHandler) ShowLandingPage(c echo.Context) error { // fmt.Println(err) return err } + lpData, err := uh.LandingPageService.GetPromotionList() + if err != nil { + // fmt.Println(err) + return err + } fmt.Printf("%+v\n", udata) - helo := landingpage.ShowLandingPage("Hello World", landingpage.MainLandingPage(udata, adData), landingpage.CssLandingPage(), landingpage.JsLandingPage()) + helo := landingpage.ShowLandingPage("Hello World", + landingpage.MainLandingPage(landingpage.ListMedicalService(udata), + landingpage.ListAdvantage(adData), landingpage.ListPromotion(lpData), + landingpage.Footer()), + landingpage.CssLandingPage(), + landingpage.JsLandingPage()) return uh.View(c, helo) } diff --git a/services/landingpage.services.go b/services/landingpage.services.go index 2308e83..c45c8f6 100644 --- a/services/landingpage.services.go +++ b/services/landingpage.services.go @@ -34,6 +34,12 @@ type AdvantageClient struct { AdvantageClientDesc string `json:"AdvantageClientDesc"` } +type Promotion struct { + PromotionID int `json:"PromotionID"` + PromotionAsset string `json:"PromotionAsset"` + PromotionLink string `json:"PromotionLink"` +} + type ServicesLandingPage struct { LandingPage LandingPage LandingPageStore db.LandingPageStore @@ -151,3 +157,25 @@ func (su *ServicesLandingPage) GetClientAdvantage() ([]AdvantageClient, error) { return data, nil } +func (su *ServicesLandingPage) GetPromotionList() ([]Promotion, error) { + + data := []Promotion{ + { + PromotionID: 1, + PromotionAsset: "../../asset-corporate-portal/media/landingpage/promotion_1.png", + PromotionLink: "", + }, + { + PromotionID: 2, + PromotionAsset: "../../asset-corporate-portal/media/landingpage/promotion_2.png", + PromotionLink: "", + }, + { + PromotionID: 3, + PromotionAsset: "../../asset-corporate-portal/media/landingpage/promotion_3.png", + PromotionLink: "", + }, + } + + return data, nil +} diff --git a/views/landingpage/landingpage.templ b/views/landingpage/landingpage.templ index 5f5d471..24ab491 100644 --- a/views/landingpage/landingpage.templ +++ b/views/landingpage/landingpage.templ @@ -2,11 +2,11 @@ package landingpage import ( "github.com/emarifer/go-templ-project-structure/views/layout" - "github.com/emarifer/go-templ-project-structure/services" ) -templ MainLandingPage(medserData []services.ClientService, adData []services.AdvantageClient) { -
+templ MainLandingPage(medicalServiceComponent templ.Component, listAdvantageComponent templ.Component, listPromotion templ.Component, footer templ.Component) { +
Under development
+
-
-
- for _, d := range medserData { - @MedicalService(d.ClientServiceName, d.ClientServiceDescription, d.ClientServiceIcon, d.ClientServiceLink) - } -
-
+ @medicalServiceComponent
@HeaderSection("Why Westerindo", "With a dedicated team of professionals we’re committed to providing medical attention tailored to your needs, ensuring a journey to optimal health and vitality.")
-
-
- Your Brand -
-
- for _, d := range adData { - @Advantage(d.AdvantageClientName, d.AdvantageClientDesc) - } -
-
+ @listAdvantageComponent
@@ -68,101 +49,12 @@ templ MainLandingPage(medserData []services.ClientService, adData []services.Adv
@HeaderSection("Promotions", "Seize This Opportunity to Enhance Your Health")
-
-
- Your Brand -
-
- Your Brand -
-
- Your Brand -
-
+ @listPromotion
- + @footer } diff --git a/views/landingpage/landingpage_templ.go b/views/landingpage/landingpage_templ.go index b7eb384..7c93e98 100644 --- a/views/landingpage/landingpage_templ.go +++ b/views/landingpage/landingpage_templ.go @@ -11,11 +11,10 @@ import "io" import "bytes" import ( - "github.com/emarifer/go-templ-project-structure/services" "github.com/emarifer/go-templ-project-structure/views/layout" ) -func MainLandingPage(medserData []services.ClientService, adData []services.AdvantageClient) templ.Component { +func MainLandingPage(medicalServiceComponent templ.Component, listAdvantageComponent templ.Component, listPromotion templ.Component, footer templ.Component) templ.Component { return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) if !templ_7745c5c3_IsBuffer { @@ -28,7 +27,7 @@ func MainLandingPage(medserData []services.ClientService, adData []services.Adva templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Under development
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -44,17 +43,15 @@ func MainLandingPage(medserData []services.ClientService, adData []services.Adva if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - for _, d := range medserData { - templ_7745c5c3_Err = MedicalService(d.ClientServiceName, d.ClientServiceDescription, d.ClientServiceIcon, d.ClientServiceLink).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } + templ_7745c5c3_Err = medicalServiceComponent.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -62,17 +59,15 @@ func MainLandingPage(medserData []services.ClientService, adData []services.Adva if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
\"Your
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - for _, d := range adData { - templ_7745c5c3_Err = Advantage(d.AdvantageClientName, d.AdvantageClientDesc).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } + templ_7745c5c3_Err = listAdvantageComponent.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -80,7 +75,23 @@ func MainLandingPage(medserData []services.ClientService, adData []services.Adva if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
\"Your
\"Your
\"Your
\"Your

Jl. Cipaku I No.5, RT.2/RW.4, Petogogan, Kec. Kby. Baru, Kota\r Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12170\r

021-7392345

021-2702525

021-7255080

Dashboard

Employee Medical Health Analytic Clinic Admission\r

Benefit

Finance & Claims

Membership

© Copyright 2024. Organized PT SADHANA ABIYASA SAMPOERNA (Privacy\r Policy)\r

") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = listPromotion.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = footer.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/views/landingpage/medicalservice.templ b/views/landingpage/medicalservice.templ index 8a16b43..a293a94 100644 --- a/views/landingpage/medicalservice.templ +++ b/views/landingpage/medicalservice.templ @@ -1,8 +1,9 @@ package landingpage -// import ( -// "github.com/emarifer/go-templ-project-structure/views/layout" -// ) +import ( + "github.com/emarifer/go-templ-project-structure/services" +) + templ MedicalService(title string, desciption string, icon string, link string) {
@@ -29,6 +30,16 @@ templ MedicalService(title string, desciption string, icon string, link string)
} +templ ListMedicalService(medserData []services.ClientService) { +
+
+ for _, d := range medserData { + @MedicalService(d.ClientServiceName, d.ClientServiceDescription, d.ClientServiceIcon, d.ClientServiceLink) + } +
+
+} + templ HeaderSection(title string, desc string) {

{ title }

@@ -57,6 +68,23 @@ templ Advantage(title string, desc string) {
} +templ ListAdvantage(adData []services.AdvantageClient) { +
+
+ Your Brand +
+
+ for _, d := range adData { + @Advantage(d.AdvantageClientName, d.AdvantageClientDesc) + } +
+
+} + templ HeaderCard() {
@@ -97,3 +125,92 @@ templ HeaderCard() {
} + +templ Promotion(prm services.Promotion) { +
+ Your Brand +
+} + +templ ListPromotion(prm []services.Promotion) { +
+ for _, d := range prm { + @Promotion(d) + } +
+} + +templ Footer() { + +} diff --git a/views/landingpage/medicalservice_templ.go b/views/landingpage/medicalservice_templ.go index 30d680c..b68a484 100644 --- a/views/landingpage/medicalservice_templ.go +++ b/views/landingpage/medicalservice_templ.go @@ -10,11 +10,10 @@ import "context" import "io" import "bytes" -// import ( -// -// "github.com/emarifer/go-templ-project-structure/views/layout" -// -// ) +import ( + "github.com/emarifer/go-templ-project-structure/services" +) + func MedicalService(title string, desciption string, icon string, link string) templ.Component { return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) @@ -35,7 +34,7 @@ func MedicalService(title string, desciption string, icon string, link string) t var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(icon) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\landingpage\medicalservice.templ`, Line: 13, Col: 22} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\landingpage\medicalservice.templ`, Line: 14, Col: 22} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -48,7 +47,7 @@ func MedicalService(title string, desciption string, icon string, link string) t var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\landingpage\medicalservice.templ`, Line: 16, Col: 46} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\landingpage\medicalservice.templ`, Line: 17, Col: 46} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -61,7 +60,7 @@ func MedicalService(title string, desciption string, icon string, link string) t var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(desciption) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\landingpage\medicalservice.templ`, Line: 18, Col: 17} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\landingpage\medicalservice.templ`, Line: 19, Col: 17} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -87,7 +86,7 @@ func MedicalService(title string, desciption string, icon string, link string) t }) } -func HeaderSection(title string, desc string) templ.Component { +func ListMedicalService(medserData []services.ClientService) templ.Component { return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) if !templ_7745c5c3_IsBuffer { @@ -100,16 +99,50 @@ func HeaderSection(title string, desc string) templ.Component { templ_7745c5c3_Var6 = templ.NopComponent } ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for _, d := range medserData { + templ_7745c5c3_Err = MedicalService(d.ClientServiceName, d.ClientServiceDescription, d.ClientServiceIcon, d.ClientServiceLink).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func HeaderSection(title string, desc string) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var7 := templ.GetChildren(ctx) + if templ_7745c5c3_Var7 == nil { + templ_7745c5c3_Var7 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var7 string - templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(title) + var templ_7745c5c3_Var8 string + templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\landingpage\medicalservice.templ`, Line: 34, Col: 46} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\landingpage\medicalservice.templ`, Line: 45, Col: 46} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -117,12 +150,12 @@ func HeaderSection(title string, desc string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var8 string - templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(desc) + var templ_7745c5c3_Var9 string + templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(desc) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\landingpage\medicalservice.templ`, Line: 36, Col: 9} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\landingpage\medicalservice.templ`, Line: 47, Col: 9} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -145,21 +178,21 @@ func Advantage(title string, desc string) templ.Component { defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var9 := templ.GetChildren(ctx) - if templ_7745c5c3_Var9 == nil { - templ_7745c5c3_Var9 = templ.NopComponent + templ_7745c5c3_Var10 := templ.GetChildren(ctx) + if templ_7745c5c3_Var10 == nil { + templ_7745c5c3_Var10 = templ.NopComponent } ctx = templ.ClearChildren(ctx) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var10 string - templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(title) + var templ_7745c5c3_Var11 string + templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\landingpage\medicalservice.templ`, Line: 51, Col: 51} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\landingpage\medicalservice.templ`, Line: 62, Col: 51} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -167,12 +200,12 @@ func Advantage(title string, desc string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var11 string - templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(desc) + var templ_7745c5c3_Var12 string + templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(desc) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\landingpage\medicalservice.templ`, Line: 53, Col: 11} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\landingpage\medicalservice.templ`, Line: 64, Col: 11} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -187,6 +220,40 @@ func Advantage(title string, desc string) templ.Component { }) } +func ListAdvantage(adData []services.AdvantageClient) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var13 := templ.GetChildren(ctx) + if templ_7745c5c3_Var13 == nil { + templ_7745c5c3_Var13 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
\"Your
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for _, d := range adData { + templ_7745c5c3_Err = Advantage(d.AdvantageClientName, d.AdvantageClientDesc).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + func HeaderCard() templ.Component { return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) @@ -195,9 +262,9 @@ func HeaderCard() templ.Component { defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var12 := templ.GetChildren(ctx) - if templ_7745c5c3_Var12 == nil { - templ_7745c5c3_Var12 = templ.NopComponent + templ_7745c5c3_Var14 := templ.GetChildren(ctx) + if templ_7745c5c3_Var14 == nil { + templ_7745c5c3_Var14 = templ.NopComponent } ctx = templ.ClearChildren(ctx) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Invest in Your Well-being with Our Comprehensive Medical\r Check-Up\r

Elevate your health journey with our thorough medical\r assessments, empowering you to take proactive steps towards a\r healthier, happier life.\r

\"Your
") @@ -210,3 +277,98 @@ func HeaderCard() templ.Component { return templ_7745c5c3_Err }) } + +func Promotion(prm services.Promotion) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var15 := templ.GetChildren(ctx) + if templ_7745c5c3_Var15 == nil { + templ_7745c5c3_Var15 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
\"Your
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func ListPromotion(prm []services.Promotion) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var17 := templ.GetChildren(ctx) + if templ_7745c5c3_Var17 == nil { + templ_7745c5c3_Var17 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for _, d := range prm { + templ_7745c5c3_Err = Promotion(d).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Footer() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var18 := templ.GetChildren(ctx) + if templ_7745c5c3_Var18 == nil { + templ_7745c5c3_Var18 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +}