42d3fedbaa
* fix(ci): fix release workflow artifact upload issue - Split artifact upload into 3 separate steps (Chrome, Firefox, Source) - Update download steps to match new artifact names - Add if-no-files-found: error for better error handling - Fix Node.js 20 compatibility issue with upload-artifact@v4 glob pattern * docs: 更新 AGENTS.md,添加测试工具和翻译文件结构说明 * docs: 更新 AGENTS.md,完善 CI 步骤和存储键名格式说明 * fix: remove unnecessary animations from StorageCleaner page - Remove entrance animations (animate-in, fade-in, zoom-in) from all components - Remove scale effect (active:scale-[0.99]) from clean button - Remove transition effects (transition-all, transition-colors) from OptionItem, StorageOptionsGrid, AutoRefreshToggle - Remove bouncing animation from error icon - Remove pulsing animation from warning banner - Keep animate-spin on button loading spinner as functional indicator * fix: remove unnecessary animations from RightClickRestorer page * fix: remove all unnecessary animations from all pages - Remove dead code animations (animate-in, fade-in, slide-in, zoom-in, shake) from tailwindcss-animate plugin (not installed) - Remove decorative transition effects (transition-all, transition-colors) from all page components - Remove scale effects (active:scale-95) from buttons - Remove bounce animations (animate-bounce) from icons - Keep functional animate-spin on loading spinners as they provide essential loading feedback Affected pages: Dashboard, Timestamp, Jwt, JsonTools, Base64Converter, HtmlToMarkdown, MarkdownToHtml, QrCode, TextStatistics --------- Co-authored-by: Ubuntu <ubuntu@localhost.localdomain>
44 lines
1.7 KiB
TypeScript
44 lines
1.7 KiB
TypeScript
import { AlertCircle } from 'lucide-react';
|
||
import { useLazyTranslation } from '@/utils/useLazyTranslation';
|
||
import { cn } from '@/lib/utils';
|
||
|
||
interface ErrorDisplayProps extends React.HTMLAttributes<HTMLDivElement> {
|
||
error: string;
|
||
}
|
||
|
||
export default function ErrorDisplay({ error, className, ...props }: ErrorDisplayProps) {
|
||
const { t } = useLazyTranslation('storageCleaner');
|
||
|
||
return (
|
||
// 1. 精简层级:单层外壳直接搞定居中、响应式高度与外部类名扩展
|
||
<div
|
||
className={cn(
|
||
'flex flex-col items-center justify-center py-8 min-h-[240px] sm:min-h-[360px] p-4 text-center',
|
||
className,
|
||
)}
|
||
{...props}
|
||
>
|
||
{/* 2. 核心卡片容器:
|
||
- 彻底放弃 bg-red-50,改用标准的 bg-destructive/5(3%~5% 透明度的系统危险色)。
|
||
- 边框改为 border-destructive/20。
|
||
- 这样在黑夜模式下会自动完美混色,绝不刺眼。
|
||
*/}
|
||
<div className="w-full max-w-xs flex flex-col items-center justify-center rounded-xl p-5 border border-destructive/20 bg-destructive/5 shadow-sm">
|
||
{/* 3. 图标与主要错误信息全面对接 text-destructive 语义色 */}
|
||
<div className="flex h-10 w-10 items-center justify-center rounded-full bg-destructive/10 text-destructive mb-3.5 shrink-0">
|
||
<AlertCircle className="h-5 w-5" />
|
||
</div>
|
||
|
||
<p className="text-sm font-semibold leading-relaxed text-destructive break-all px-1 mb-2">
|
||
{error}
|
||
</p>
|
||
|
||
{/* 次要提示文本维持柔和的中性高级灰 */}
|
||
<p className="text-xs font-medium leading-relaxed text-muted-foreground/90 px-2">
|
||
{t('storageCleaner:errorStandardOnly')}
|
||
</p>
|
||
</div>
|
||
</div>
|
||
);
|
||
}
|