@sikka/hawa 0.49.7-next → 0.49.9-next
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocks/auth/index.d.mts +1 -0
- package/dist/blocks/auth/index.d.ts +1 -0
- package/dist/blocks/auth/index.js +102 -96
- package/dist/blocks/auth/index.mjs +102 -96
- package/dist/blocks/index.d.mts +1 -0
- package/dist/blocks/index.d.ts +1 -0
- package/dist/blocks/index.js +102 -96
- package/dist/blocks/index.mjs +102 -96
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +102 -96
- package/dist/index.mjs +102 -96
- package/package.json +1 -1
package/dist/blocks/index.js
CHANGED
@@ -4473,8 +4473,15 @@ var RegisterForm = ({
|
|
4473
4473
|
continueWithEmail: texts == null ? void 0 : texts.continueWithEmail,
|
4474
4474
|
continueWithPhone: texts == null ? void 0 : texts.continueWithPhone
|
4475
4475
|
};
|
4476
|
-
const methods = (0, import_react_hook_form2.useForm)();
|
4477
4476
|
let fieldSchemas = {};
|
4477
|
+
let remainingFieldsSchema = z2.object({
|
4478
|
+
refCode: z2.string().optional(),
|
4479
|
+
reference: z2.string().optional(),
|
4480
|
+
terms_accepted: showTermsOption ? z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
|
4481
|
+
message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
|
4482
|
+
}) : z2.boolean().optional(),
|
4483
|
+
newsletter_accepted: z2.boolean().optional()
|
4484
|
+
});
|
4478
4485
|
const hasPhoneType = registerTypes == null ? void 0 : registerTypes.some((type) => type.value === "phone");
|
4479
4486
|
if (hasPhoneType && selectedRegisterType.value === "phone") {
|
4480
4487
|
registerFields = ["phone"];
|
@@ -4529,13 +4536,7 @@ var RegisterForm = ({
|
|
4529
4536
|
return isPhoneValid;
|
4530
4537
|
},
|
4531
4538
|
{ message: ((_d = texts == null ? void 0 : texts.phone) == null ? void 0 : _d.invalid) || "Phone Number Invalid" }
|
4532
|
-
)
|
4533
|
-
refCode: z2.string().optional(),
|
4534
|
-
reference: z2.string().optional(),
|
4535
|
-
terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
|
4536
|
-
message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
|
4537
|
-
}),
|
4538
|
-
newsletter_accepted: z2.boolean().optional()
|
4539
|
+
)
|
4539
4540
|
});
|
4540
4541
|
} else {
|
4541
4542
|
formSchema = z2.object({
|
@@ -4553,21 +4554,24 @@ var RegisterForm = ({
|
|
4553
4554
|
message: ((_i = texts == null ? void 0 : texts.password) == null ? void 0 : _i.tooShort) || "Password is too short"
|
4554
4555
|
}).refine((value) => value !== "", {
|
4555
4556
|
message: ((_j = texts == null ? void 0 : texts.password) == null ? void 0 : _j.required) || "Confirm password is required"
|
4556
|
-
})
|
4557
|
-
refCode: z2.string().optional(),
|
4558
|
-
reference: z2.string().optional(),
|
4559
|
-
terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
|
4560
|
-
message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
|
4561
|
-
}),
|
4562
|
-
newsletter_accepted: z2.boolean().optional()
|
4557
|
+
})
|
4563
4558
|
}).refine((data) => data.password === data.confirm_password, {
|
4564
4559
|
message: ((_k = texts == null ? void 0 : texts.confirm) == null ? void 0 : _k.dontMatch) || "Passwords don't match",
|
4565
4560
|
path: ["confirm_password"]
|
4566
4561
|
});
|
4567
4562
|
}
|
4568
|
-
|
4569
|
-
|
4563
|
+
let finalSchema = z2.intersection(formSchema, remainingFieldsSchema);
|
4564
|
+
const methods = (0, import_react_hook_form2.useForm)({
|
4565
|
+
resolver: (0, import_zod2.zodResolver)(finalSchema)
|
4570
4566
|
});
|
4567
|
+
const onSubmit = (data) => {
|
4568
|
+
console.log("Form submitted with data:", data);
|
4569
|
+
if (props.onRegister) {
|
4570
|
+
props.onRegister(data);
|
4571
|
+
} else {
|
4572
|
+
console.log("onRegister prop is missing");
|
4573
|
+
}
|
4574
|
+
};
|
4571
4575
|
return /* @__PURE__ */ import_react37.default.createElement("div", { className: cn("hawa-flex hawa-flex-col", (_l = props.classNames) == null ? void 0 : _l.root) }, /* @__PURE__ */ import_react37.default.createElement(
|
4572
4576
|
Card,
|
4573
4577
|
{
|
@@ -4607,13 +4611,7 @@ var RegisterForm = ({
|
|
4607
4611
|
{
|
4608
4612
|
id: "register_form",
|
4609
4613
|
noValidate: true,
|
4610
|
-
onSubmit: handleSubmit(
|
4611
|
-
if (props.onRegister) {
|
4612
|
-
return props.onRegister(e);
|
4613
|
-
} else {
|
4614
|
-
console.log("Form is submitted but onRegister prop is missing");
|
4615
|
-
}
|
4616
|
-
}),
|
4614
|
+
onSubmit: methods.handleSubmit(onSubmit),
|
4617
4615
|
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
4618
4616
|
},
|
4619
4617
|
/* @__PURE__ */ import_react37.default.createElement(
|
@@ -4650,7 +4648,7 @@ var RegisterForm = ({
|
|
4650
4648
|
import_react_hook_form2.Controller,
|
4651
4649
|
{
|
4652
4650
|
key: i,
|
4653
|
-
control,
|
4651
|
+
control: methods.control,
|
4654
4652
|
name: "fullName",
|
4655
4653
|
render: ({ field }) => {
|
4656
4654
|
var _a2, _b2, _c2;
|
@@ -4660,7 +4658,7 @@ var RegisterForm = ({
|
|
4660
4658
|
width: "full",
|
4661
4659
|
label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
|
4662
4660
|
placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
|
4663
|
-
helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
|
4661
|
+
helperText: (_c2 = methods.formState.errors.fullName) == null ? void 0 : _c2.message,
|
4664
4662
|
...field
|
4665
4663
|
}
|
4666
4664
|
);
|
@@ -4673,7 +4671,7 @@ var RegisterForm = ({
|
|
4673
4671
|
import_react_hook_form2.Controller,
|
4674
4672
|
{
|
4675
4673
|
key: i,
|
4676
|
-
control,
|
4674
|
+
control: methods.control,
|
4677
4675
|
name: "email",
|
4678
4676
|
render: ({ field }) => {
|
4679
4677
|
var _a2, _b2, _c2;
|
@@ -4687,7 +4685,7 @@ var RegisterForm = ({
|
|
4687
4685
|
width: "full",
|
4688
4686
|
autoComplete: "email",
|
4689
4687
|
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
4690
|
-
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
4688
|
+
helperText: (_b2 = methods.formState.errors.email) == null ? void 0 : _b2.message,
|
4691
4689
|
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
|
4692
4690
|
...field,
|
4693
4691
|
onChange: (e) => {
|
@@ -4704,7 +4702,7 @@ var RegisterForm = ({
|
|
4704
4702
|
import_react_hook_form2.Controller,
|
4705
4703
|
{
|
4706
4704
|
key: i,
|
4707
|
-
control,
|
4705
|
+
control: methods.control,
|
4708
4706
|
name: "username",
|
4709
4707
|
render: ({ field }) => {
|
4710
4708
|
var _a2, _b2, _c2, _d2, _e2;
|
@@ -4717,7 +4715,7 @@ var RegisterForm = ({
|
|
4717
4715
|
labelProps: ((_b2 = props.usernameOptions) == null ? void 0 : _b2.label) ? {
|
4718
4716
|
...(_c2 = props.usernameOptions) == null ? void 0 : _c2.label
|
4719
4717
|
} : void 0,
|
4720
|
-
helperText: (_d2 = formState.errors.username) == null ? void 0 : _d2.message,
|
4718
|
+
helperText: (_d2 = methods.formState.errors.username) == null ? void 0 : _d2.message,
|
4721
4719
|
placeholder: (_e2 = texts == null ? void 0 : texts.username) == null ? void 0 : _e2.placeholder,
|
4722
4720
|
...field
|
4723
4721
|
}
|
@@ -4730,7 +4728,7 @@ var RegisterForm = ({
|
|
4730
4728
|
/* @__PURE__ */ import_react37.default.createElement(
|
4731
4729
|
import_react_hook_form2.Controller,
|
4732
4730
|
{
|
4733
|
-
control,
|
4731
|
+
control: methods.control,
|
4734
4732
|
name: "password",
|
4735
4733
|
render: ({ field }) => {
|
4736
4734
|
var _a2, _b2, _c2;
|
@@ -4742,7 +4740,7 @@ var RegisterForm = ({
|
|
4742
4740
|
autoComplete: "new-password",
|
4743
4741
|
label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
|
4744
4742
|
placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
|
4745
|
-
helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
|
4743
|
+
helperText: (_c2 = methods.formState.errors.password) == null ? void 0 : _c2.message,
|
4746
4744
|
endIcon: /* @__PURE__ */ import_react37.default.createElement(
|
4747
4745
|
"div",
|
4748
4746
|
{
|
@@ -4761,7 +4759,7 @@ var RegisterForm = ({
|
|
4761
4759
|
/* @__PURE__ */ import_react37.default.createElement(
|
4762
4760
|
import_react_hook_form2.Controller,
|
4763
4761
|
{
|
4764
|
-
control,
|
4762
|
+
control: methods.control,
|
4765
4763
|
name: "confirm_password",
|
4766
4764
|
render: ({ field }) => {
|
4767
4765
|
var _a2, _b2, _c2;
|
@@ -4773,7 +4771,7 @@ var RegisterForm = ({
|
|
4773
4771
|
autoComplete: "new-password",
|
4774
4772
|
label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
|
4775
4773
|
placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
|
4776
|
-
helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
|
4774
|
+
helperText: (_c2 = methods.formState.errors.confirm_password) == null ? void 0 : _c2.message,
|
4777
4775
|
endIcon: /* @__PURE__ */ import_react37.default.createElement(
|
4778
4776
|
"div",
|
4779
4777
|
{
|
@@ -4793,7 +4791,7 @@ var RegisterForm = ({
|
|
4793
4791
|
props.showRefCode && /* @__PURE__ */ import_react37.default.createElement(
|
4794
4792
|
import_react_hook_form2.Controller,
|
4795
4793
|
{
|
4796
|
-
control,
|
4794
|
+
control: methods.control,
|
4797
4795
|
name: "refCode",
|
4798
4796
|
render: ({ field }) => {
|
4799
4797
|
var _a2;
|
@@ -4803,7 +4801,7 @@ var RegisterForm = ({
|
|
4803
4801
|
width: "full",
|
4804
4802
|
label: texts == null ? void 0 : texts.refCode,
|
4805
4803
|
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
4806
|
-
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
4804
|
+
helperText: (_a2 = methods.formState.errors.refCode) == null ? void 0 : _a2.message,
|
4807
4805
|
...field
|
4808
4806
|
}
|
4809
4807
|
);
|
@@ -4813,7 +4811,7 @@ var RegisterForm = ({
|
|
4813
4811
|
props.showUserSource && /* @__PURE__ */ import_react37.default.createElement(
|
4814
4812
|
import_react_hook_form2.Controller,
|
4815
4813
|
{
|
4816
|
-
control,
|
4814
|
+
control: methods.control,
|
4817
4815
|
name: "reference",
|
4818
4816
|
render: ({ field }) => {
|
4819
4817
|
var _a2, _b2;
|
@@ -4847,7 +4845,7 @@ var RegisterForm = ({
|
|
4847
4845
|
/* @__PURE__ */ import_react37.default.createElement(
|
4848
4846
|
import_react_hook_form2.Controller,
|
4849
4847
|
{
|
4850
|
-
control,
|
4848
|
+
control: methods.control,
|
4851
4849
|
name: "phone",
|
4852
4850
|
render: ({ field }) => {
|
4853
4851
|
var _a2, _b2;
|
@@ -4855,7 +4853,7 @@ var RegisterForm = ({
|
|
4855
4853
|
PhoneInput,
|
4856
4854
|
{
|
4857
4855
|
label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
|
4858
|
-
helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
|
4856
|
+
helperText: (_b2 = methods.formState.errors.phone) == null ? void 0 : _b2.message,
|
4859
4857
|
preferredCountry: { label: "+966" },
|
4860
4858
|
...props.phoneInputProps,
|
4861
4859
|
handleChange: (e) => {
|
@@ -4875,7 +4873,7 @@ var RegisterForm = ({
|
|
4875
4873
|
props.showRefCode && /* @__PURE__ */ import_react37.default.createElement(
|
4876
4874
|
import_react_hook_form2.Controller,
|
4877
4875
|
{
|
4878
|
-
control,
|
4876
|
+
control: methods.control,
|
4879
4877
|
name: "refCode",
|
4880
4878
|
render: ({ field }) => {
|
4881
4879
|
var _a2;
|
@@ -4885,7 +4883,7 @@ var RegisterForm = ({
|
|
4885
4883
|
width: "full",
|
4886
4884
|
label: texts == null ? void 0 : texts.refCode,
|
4887
4885
|
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
4888
|
-
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
4886
|
+
helperText: (_a2 = methods.formState.errors.refCode) == null ? void 0 : _a2.message,
|
4889
4887
|
...field
|
4890
4888
|
}
|
4891
4889
|
);
|
@@ -4895,7 +4893,7 @@ var RegisterForm = ({
|
|
4895
4893
|
props.showUserSource && /* @__PURE__ */ import_react37.default.createElement(
|
4896
4894
|
import_react_hook_form2.Controller,
|
4897
4895
|
{
|
4898
|
-
control,
|
4896
|
+
control: methods.control,
|
4899
4897
|
name: "reference",
|
4900
4898
|
render: ({ field }) => {
|
4901
4899
|
var _a2, _b2;
|
@@ -4919,7 +4917,7 @@ var RegisterForm = ({
|
|
4919
4917
|
showTermsOption || showNewsletterOption ? /* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ import_react37.default.createElement(
|
4920
4918
|
import_react_hook_form2.Controller,
|
4921
4919
|
{
|
4922
|
-
control,
|
4920
|
+
control: methods.control,
|
4923
4921
|
name: "terms_accepted",
|
4924
4922
|
render: ({ field }) => {
|
4925
4923
|
var _a2, _b2;
|
@@ -4927,7 +4925,7 @@ var RegisterForm = ({
|
|
4927
4925
|
Checkbox,
|
4928
4926
|
{
|
4929
4927
|
id: "terms_accepted",
|
4930
|
-
helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
|
4928
|
+
helperText: (_b2 = (_a2 = methods.formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
|
4931
4929
|
onCheckedChange: (e) => field.onChange(e),
|
4932
4930
|
label: /* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-0.5 hawa-whitespace-nowrap hawa-flex-wrap" }, (texts == null ? void 0 : texts.iAcceptText) || "I accept the", " ", /* @__PURE__ */ import_react37.default.createElement(StopPropagationWrapper, null, /* @__PURE__ */ import_react37.default.createElement(
|
4933
4931
|
"span",
|
@@ -4949,7 +4947,7 @@ var RegisterForm = ({
|
|
4949
4947
|
), showNewsletterOption && /* @__PURE__ */ import_react37.default.createElement(
|
4950
4948
|
import_react_hook_form2.Controller,
|
4951
4949
|
{
|
4952
|
-
control,
|
4950
|
+
control: methods.control,
|
4953
4951
|
name: "newsletter_accepted",
|
4954
4952
|
render: ({ field }) => /* @__PURE__ */ import_react37.default.createElement(
|
4955
4953
|
Checkbox,
|
@@ -5389,63 +5387,71 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
5389
5387
|
}
|
5390
5388
|
};
|
5391
5389
|
}, []);
|
5392
|
-
return /* @__PURE__ */ import_react44.default.createElement(
|
5393
|
-
|
5390
|
+
return /* @__PURE__ */ import_react44.default.createElement(
|
5391
|
+
Card,
|
5394
5392
|
{
|
5395
|
-
|
5396
|
-
|
5397
|
-
|
5398
|
-
return props.onConfirm(e);
|
5399
|
-
} else {
|
5400
|
-
console.log("Form is submitted but onConfirm prop is missing");
|
5401
|
-
}
|
5402
|
-
})
|
5393
|
+
className: cn(
|
5394
|
+
props.cardless && "hawa-border-none hawa-bg-transparent !hawa-shadow-none !hawa-drop-shadow-none"
|
5395
|
+
)
|
5403
5396
|
},
|
5404
|
-
/* @__PURE__ */ import_react44.default.createElement(
|
5405
|
-
|
5406
|
-
{
|
5407
|
-
control,
|
5408
|
-
name: "otp_code",
|
5409
|
-
render: ({ field }) => {
|
5410
|
-
var _a2;
|
5411
|
-
return /* @__PURE__ */ import_react44.default.createElement(
|
5412
|
-
PinInput,
|
5413
|
-
{
|
5414
|
-
maxLength: codeLength,
|
5415
|
-
helperText: (_a2 = formState.errors.otp_code) == null ? void 0 : _a2.message,
|
5416
|
-
...field
|
5417
|
-
}
|
5418
|
-
);
|
5419
|
-
}
|
5420
|
-
}
|
5421
|
-
),
|
5422
|
-
showResendTimer ? /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, (_e = props.texts) == null ? void 0 : _e.resendCodeTimer, " ", /* @__PURE__ */ import_react44.default.createElement("strong", null, remainingTime), " ", (_f = props.texts) == null ? void 0 : _f.seconds) : /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, /* @__PURE__ */ import_react44.default.createElement("span", null, (_h = (_g = props.texts) == null ? void 0 : _g.didntGetCode) != null ? _h : "Didn't get the code?"), " ", /* @__PURE__ */ import_react44.default.createElement(
|
5423
|
-
"span",
|
5424
|
-
{
|
5425
|
-
className: "clickable-link",
|
5426
|
-
onClick: () => {
|
5427
|
-
startResendTimer();
|
5428
|
-
props.onResend();
|
5429
|
-
}
|
5430
|
-
},
|
5431
|
-
((_i = props.texts) == null ? void 0 : _i.resendCode) || "Click to resend"
|
5432
|
-
)),
|
5433
|
-
/* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-mt-4 hawa-grid hawa-grid-cols-2 hawa-gap-2" }, /* @__PURE__ */ import_react44.default.createElement(
|
5434
|
-
Button,
|
5397
|
+
/* @__PURE__ */ import_react44.default.createElement(CardContent, { headless: true, noPadding: props.cardless }, props.showError && /* @__PURE__ */ import_react44.default.createElement(Alert, { title: props.errorTitle, text: props.errorText, severity: "error" }), /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourIdentifier) || "Please check your phone"), /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-text-muted-foreground hawa-flex hawa-flex-row" }, /* @__PURE__ */ import_react44.default.createElement("span", null, `${(_d = props.texts) == null ? void 0 : _d.weSentCode} ` || `We've sent a code to `, /* @__PURE__ */ import_react44.default.createElement("span", { dir: "ltr" }, props.identifier)))), /* @__PURE__ */ import_react44.default.createElement(
|
5398
|
+
"form",
|
5435
5399
|
{
|
5436
|
-
|
5437
|
-
|
5438
|
-
if (props.
|
5439
|
-
return props.
|
5400
|
+
noValidate: true,
|
5401
|
+
onSubmit: handleSubmit((e) => {
|
5402
|
+
if (props.onConfirm) {
|
5403
|
+
return props.onConfirm(e);
|
5440
5404
|
} else {
|
5441
|
-
console.log("
|
5405
|
+
console.log("Form is submitted but onConfirm prop is missing");
|
5442
5406
|
}
|
5443
|
-
}
|
5444
|
-
variant: "outline"
|
5407
|
+
})
|
5445
5408
|
},
|
5446
|
-
|
5447
|
-
|
5448
|
-
|
5409
|
+
/* @__PURE__ */ import_react44.default.createElement(
|
5410
|
+
import_react_hook_form5.Controller,
|
5411
|
+
{
|
5412
|
+
control,
|
5413
|
+
name: "otp_code",
|
5414
|
+
render: ({ field }) => {
|
5415
|
+
var _a2;
|
5416
|
+
return /* @__PURE__ */ import_react44.default.createElement(
|
5417
|
+
PinInput,
|
5418
|
+
{
|
5419
|
+
maxLength: codeLength,
|
5420
|
+
helperText: (_a2 = formState.errors.otp_code) == null ? void 0 : _a2.message,
|
5421
|
+
...field
|
5422
|
+
}
|
5423
|
+
);
|
5424
|
+
}
|
5425
|
+
}
|
5426
|
+
),
|
5427
|
+
showResendTimer ? /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, (_e = props.texts) == null ? void 0 : _e.resendCodeTimer, " ", /* @__PURE__ */ import_react44.default.createElement("strong", null, remainingTime), " ", (_f = props.texts) == null ? void 0 : _f.seconds) : /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, /* @__PURE__ */ import_react44.default.createElement("span", null, (_h = (_g = props.texts) == null ? void 0 : _g.didntGetCode) != null ? _h : "Didn't get the code?"), " ", /* @__PURE__ */ import_react44.default.createElement(
|
5428
|
+
"span",
|
5429
|
+
{
|
5430
|
+
className: "clickable-link",
|
5431
|
+
onClick: () => {
|
5432
|
+
startResendTimer();
|
5433
|
+
props.onResend();
|
5434
|
+
}
|
5435
|
+
},
|
5436
|
+
((_i = props.texts) == null ? void 0 : _i.resendCode) || "Click to resend"
|
5437
|
+
)),
|
5438
|
+
/* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-mt-4 hawa-grid hawa-grid-cols-2 hawa-gap-2" }, /* @__PURE__ */ import_react44.default.createElement(
|
5439
|
+
Button,
|
5440
|
+
{
|
5441
|
+
type: "button",
|
5442
|
+
onClick: () => {
|
5443
|
+
if (props.onCancel) {
|
5444
|
+
return props.onCancel();
|
5445
|
+
} else {
|
5446
|
+
console.log("Cancel button clicked but onCancel prop is missing");
|
5447
|
+
}
|
5448
|
+
},
|
5449
|
+
variant: "outline"
|
5450
|
+
},
|
5451
|
+
((_j = props.texts) == null ? void 0 : _j.cancel) || "Cancel"
|
5452
|
+
), /* @__PURE__ */ import_react44.default.createElement(Button, { isLoading: props.confirmLoading }, ((_k = props.texts) == null ? void 0 : _k.confirm) || "Confirm"))
|
5453
|
+
))
|
5454
|
+
);
|
5449
5455
|
};
|
5450
5456
|
|
5451
5457
|
// blocks/feedback/UserReferralSource.tsx
|