(email?: string, showVerificationCode = false)
| 175 | } |
| 176 | |
| 177 | function formFields(email?: string, showVerificationCode = false) { |
| 178 | const fields: FormField[] = [ |
| 179 | { |
| 180 | name: 'email', |
| 181 | label: 'Email', |
| 182 | type: 'email', |
| 183 | placeholder: 'jane.doe@example.com', |
| 184 | value: email || '', |
| 185 | required: true, |
| 186 | }, |
| 187 | { |
| 188 | name: 'password', |
| 189 | label: 'Password', |
| 190 | type: 'password', |
| 191 | placeholder: 'super-SECRET-passphrase', |
| 192 | required: true, |
| 193 | }, |
| 194 | ]; |
| 195 | |
| 196 | if (showVerificationCode) { |
| 197 | fields.push({ |
| 198 | name: 'verification-code', |
| 199 | label: 'Verification Code', |
| 200 | description: `The verification code to validate your email.`, |
| 201 | type: 'text', |
| 202 | placeholder: '000000', |
| 203 | required: true, |
| 204 | }); |
| 205 | } |
| 206 | |
| 207 | return fields; |
| 208 | } |
| 209 | |
| 210 | function defaultHtmlContent( |
| 211 | { |
no outgoing calls
no test coverage detected