mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-26 11:06:23 +00:00
feat: 在验证码组件中添加错误状态显示,提升用户反馈体验
This commit is contained in:
@ -63,7 +63,8 @@ export function TurnstileWidget(props: CaptchaProps) {
|
||||
<div className="flex items-center justify-evenly w-full border border-gray-300 rounded-md px-4 py-2 relative">
|
||||
{status === 'loading' && <Spinner />}
|
||||
{status === 'success' && <CheckMark />}
|
||||
<div className="flex-1 text-center">{status === 'success' ? t("success") :t("doing")}</div>
|
||||
{status === 'error' && <ErrorMark />}
|
||||
<div className="flex-1 text-center">{status === 'success' ? t("success") : (status === 'error' ? t("error") : t("doing"))}</div>
|
||||
<div className="absolute inset-0 opacity-0 pointer-events-none">
|
||||
<OfficialTurnstileWidget {...props} onSuccess={handleSuccess} onError={handleError} />
|
||||
</div>
|
||||
|
@ -4,6 +4,7 @@
|
||||
},
|
||||
"Captcha": {
|
||||
"doing": "正在检测你是不是机器人...",
|
||||
"error": "验证失败,请重试。",
|
||||
"success": "恭喜,你是人类!"
|
||||
},
|
||||
"Comment": {
|
||||
|
Reference in New Issue
Block a user