package mastermenuusergrouptryandy

import (
	"cpone/models"
	"cpone/component/customtextfield"
)

templ DialogNewBody(code string, name string, codeErrorMsg string, nameErrorMsg string) {
	<div id="modalbdy">
		@customtextfield.CustomTextFieldv2(
			models.CustomTextFieldv2Prm{
				Label:       "Kode user group",
				Name:        "usergroupcode",
				Placeholder: "Kode user Group",
				Type:        "text",
				Value:       code,
				ErrorMsg:    codeErrorMsg,
			})
		@customtextfield.CustomTextFieldv2(
			models.CustomTextFieldv2Prm{
				Label:       "Nama User Group",
				Name:        "usergroupname",
				Placeholder: "Nama User Group",
				Type:        "text",
				Value:       name,
				ErrorMsg:    nameErrorMsg,
			})
	</div>
}

templ DialogErrorBody(code string, name string) {
	<div id="testttt" class="p-6" hx-swap-oob="#testttt">
		@customtextfield.CustomTextFieldv2(
			models.CustomTextFieldv2Prm{
				Label:       "Kode user group sasa",
				Name:        "usergroupcode",
				Placeholder: "Kode user Group",
				Type:        "text",
				Value:       code,
				ErrorMsg:    "error",
			})
		@customtextfield.CustomTextFieldv2(
			models.CustomTextFieldv2Prm{
				Label:       "Nama User Group",
				Name:        "usergroupname",
				Placeholder: "Nama User Group",
				Type:        "text",
				Value:       name,
			})
	</div>
}

templ DialogNewAction() {
	<div>
		<button
			type="button"
			class="btn btn-outline-secondary font-weight-bolder rounded-lg mr-4"
			data-dismiss="modal"
		>
			Batal
		</button>
		<button
			type="button"
			class="btn btn-primary btn-shadow font-weight-bold rounded-lg"
		>
			Save changes
		</button>
	</div>
}

templ BtnCloseNew() {
	<button
		type="button"
		class="close"
		data-dismiss="modal"
		aria-label="Close"
	>
		<i aria-hidden="true" class="ki ki-close"></i>
	</button>
}

templ CobaSwapOOB(code string, name string, errorCode string, errorName string) {
	@DialogNewBody(code, name, errorCode, errorName)
	@DialogErrorBody(code, name)
}
