Refactor SupabaseConnectionTest component
The SupabaseConnectionTest component was refactored into smaller, more manageable components to improve readability and maintainability.
This commit is contained in:
34
src/components/supabase/ProxyRecommendationAlert.tsx
Normal file
34
src/components/supabase/ProxyRecommendationAlert.tsx
Normal 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;
|
||||
Reference in New Issue
Block a user