From 3ae42f054ffc086ecc6ced46df84f7244faf4788 Mon Sep 17 00:00:00 2001 From: Pallavi Kumari Date: Tue, 21 Oct 2025 17:07:34 +0530 Subject: [PATCH] show the wildcard record info --- src/components/CreateDomainForm.tsx | 1 - src/components/DomainInfoCard.tsx | 185 +++++++++++++++------------- 2 files changed, 99 insertions(+), 87 deletions(-) diff --git a/src/components/CreateDomainForm.tsx b/src/components/CreateDomainForm.tsx index bdbf558c..1fa61bd9 100644 --- a/src/components/CreateDomainForm.tsx +++ b/src/components/CreateDomainForm.tsx @@ -321,7 +321,6 @@ export default function CreateDomainForm({ name="certResolver" render={({ field }) => ( - {t("customResolver")} { if (domain.domainId) { - const certResolverValue = domain.certResolver && domain.certResolver.trim() !== "" - ? domain.certResolver + const certResolverValue = domain.certResolver && domain.certResolver.trim() !== "" + ? domain.certResolver : null; form.reset({ @@ -257,19 +257,18 @@ export default function DomainInfoCard({ orgId, domainId }: DomainInfoCardProps) - {domain.type !== "wildcard" && ( - loadingRecords ? ( -
- {t("loadingDNSRecords", { fallback: "Loading DNS Records..." })} -
- ) : ( - - ) - )} + {loadingRecords ? ( +
+ {t("loadingDNSRecords", { fallback: "Loading DNS Records..." })} +
+ ) : ( + + ) + } {/* Domain Settings - Only show for wildcard domains */} {domain.type === "wildcard" && ( @@ -289,78 +288,92 @@ export default function DomainInfoCard({ orgId, domainId }: DomainInfoCardProps) className="space-y-4" id="domain-settings-form" > - ( - - {t("certResolver")} - - - - - - - {certResolverOptions.map((opt) => ( - - {opt.title} - - ))} - - - - - {field.value !== null && field.value !== "default" && ( -
- - field.onChange(e.target.value)} - /> - - ( - - -
- - {t("preferWildcardCert")} -
-
+ onValueChange={(val) => { + if (val === "default") { + field.onChange(null); + } else if (val === "custom") { + field.onChange(""); + } else { + field.onChange(val); + } + }} + > + + + + + {certResolverOptions.map((opt) => ( + + {opt.title} + + ))} + + + + +
+ )} + /> + {form.watch("certResolver") !== null && + form.watch("certResolver") !== "default" && ( + ( + + + field.onChange(e.target.value)} + /> + + + + )} + /> + )} - - {t("preferWildcardCertDescription")} - - - - )} - /> -
- )} -
- )} - /> + {form.watch("certResolver") !== null && + form.watch("certResolver") !== "default" && ( + ( + + +
+ + {t("preferWildcardCert")} +
+
+ + + {t("preferWildcardCertDescription")} + + +
+ )} + /> + )} +