Refactor SupabaseConnectionTest component

The SupabaseConnectionTest component was refactored into smaller, more manageable components to improve readability and maintainability.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-15 12:45:12 +00:00
parent 1e6d360d69
commit 971a1d29e5
10 changed files with 320 additions and 177 deletions

View File

@@ -0,0 +1,34 @@
import React from 'react';
import { AlertCircle } from "lucide-react";
import { Alert, AlertTitle, AlertDescription } from "@/components/ui/alert";
interface ProxyRecommendationAlertProps {
errors: string[];
}
const ProxyRecommendationAlert: React.FC<ProxyRecommendationAlertProps> = ({ errors }) => {
const hasProxyRecommendation = errors.some(err =>
err.includes('프록시 사용 시 정상 작동합니다') ||
err.includes('프록시를 선택해보세요')
);
if (!hasProxyRecommendation || errors.length === 0) return null;
const recommendationMessage = errors.find(err =>
err.includes('프록시 사용 시 정상 작동합니다') ||
err.includes('프록시를 선택해보세요')
);
return (
<Alert className="bg-amber-50 border-amber-200 mt-3">
<AlertCircle className="h-4 w-4 text-amber-600" />
<AlertTitle className="text-amber-800 text-xs font-medium"> </AlertTitle>
<AlertDescription className="text-amber-700 text-xs">
{recommendationMessage}
</AlertDescription>
</Alert>
);
};
export default ProxyRecommendationAlert;