用 Tailwind CSS 重写 StorageCleaner 页面,创建 shadcn/ui Dialog 组件
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { Alert, Box } from '@mui/material';
|
||||
import { CheckCircle, XCircle } from 'lucide-react';
|
||||
import type { CleaningResult } from '@/types/storage';
|
||||
import { formatCleaningResult } from '@/utils/storageCleaner';
|
||||
import { storageCleanerPageStyles } from '@/config/pageTheme';
|
||||
import { useLazyTranslation } from '@/utils/useLazyTranslation';
|
||||
|
||||
interface CleaningResultProps {
|
||||
@@ -12,16 +11,30 @@ export default function CleaningResult({ result }: CleaningResultProps) {
|
||||
const { t } = useLazyTranslation('storageCleaner');
|
||||
if (!result) return null;
|
||||
|
||||
const isSuccess = result.success;
|
||||
|
||||
return (
|
||||
<Box sx={{ mt: 3, animation: 'fadeIn 0.3s ease-in-out' }}>
|
||||
<Alert
|
||||
severity={result.success ? 'success' : 'error'}
|
||||
sx={storageCleanerPageStyles.CLEANING_RESULT_ALERT}
|
||||
<div className="mt-3 animate-in fade-in duration-300">
|
||||
<div
|
||||
className={`flex items-start gap-3 rounded-lg py-3 px-4 shadow-sm ${
|
||||
isSuccess ? 'bg-green-50 border border-green-200' : 'bg-red-50 border border-red-200'
|
||||
}`}
|
||||
>
|
||||
{result.success
|
||||
? formatCleaningResult(result, t)
|
||||
: result.error || t('storageCleaner:partialFailure')}
|
||||
</Alert>
|
||||
</Box>
|
||||
{isSuccess ? (
|
||||
<CheckCircle className="h-5 w-5 text-green-500 flex-shrink-0 mt-0.5" />
|
||||
) : (
|
||||
<XCircle className="h-5 w-5 text-red-500 flex-shrink-0 mt-0.5" />
|
||||
)}
|
||||
<span
|
||||
className={`text-sm font-semibold leading-relaxed ${
|
||||
isSuccess ? 'text-green-700' : 'text-red-700'
|
||||
}`}
|
||||
>
|
||||
{isSuccess
|
||||
? formatCleaningResult(result, t)
|
||||
: result.error || t('storageCleaner:partialFailure')}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user