@@ -45,6 +45,15 @@ export default function CustomDomainForm ({ sub }) {
45
45
}
46
46
}
47
47
48
+ const getSSLStatusBadge = ( sslEnabled ) => {
49
+ switch ( sslEnabled ) {
50
+ case true :
51
+ return < Badge bg = 'success' > SSL enabled</ Badge >
52
+ case false :
53
+ return < Badge bg = 'danger' > SSL disabled</ Badge >
54
+ }
55
+ }
56
+
48
57
return (
49
58
< Form
50
59
initial = { {
@@ -61,25 +70,28 @@ export default function CustomDomainForm ({ sub }) {
61
70
{ error && < Info variant = 'danger' > error</ Info > }
62
71
{ success && < Info variant = 'success' > Domain settings updated successfully!</ Info > }
63
72
{ sub ?. customDomain && (
64
- < div className = 'd-flex align-items-center gap-2' >
65
- { getStatusBadge ( sub . customDomain . verificationState ) }
66
- < span className = 'text-muted' >
67
- { sub . customDomain . lastVerifiedAt &&
68
- ` (Last checked: ${ new Date ( sub . customDomain . lastVerifiedAt ) . toLocaleString ( ) } )` }
69
- </ span >
73
+ < >
74
+ < div className = 'd-flex align-items-center gap-2' >
75
+ { getStatusBadge ( sub . customDomain . verificationState ) }
76
+ < span className = 'text-muted' >
77
+ { sub . customDomain . lastVerifiedAt &&
78
+ ` (Last checked: ${ new Date ( sub . customDomain . lastVerifiedAt ) . toLocaleString ( ) } )` }
79
+ </ span >
70
80
71
- { sub . customDomain . verificationState === 'PENDING' && (
72
- < Info >
73
- < h6 > Verify your domain</ h6 >
74
- < p > Add the following DNS records to verify ownership of your domain:</ p >
75
- < pre >
76
- CNAME record:
77
- Host: @
78
- Value: stacker.news
79
- </ pre >
80
- </ Info >
81
- ) }
82
- </ div >
81
+ { sub . customDomain . verificationState === 'PENDING' && (
82
+ < Info >
83
+ < h6 > Verify your domain</ h6 >
84
+ < p > Add the following DNS records to verify ownership of your domain:</ p >
85
+ < pre >
86
+ CNAME record:
87
+ Host: @
88
+ Value: stacker.news
89
+ </ pre >
90
+ </ Info >
91
+ ) }
92
+ </ div >
93
+ { getSSLStatusBadge ( sub . customDomain . sslEnabled ) }
94
+ </ >
83
95
) }
84
96
</ div >
85
97
}
0 commit comments