Files
zellyy-finance/src/components/supabase/ProxyRecommendationAlert.tsx
gpt-engineer-app[bot] 5fd4c183eb Update Supabase connection tests
Improve error handling for REST API and database connection tests.
2025-03-15 12:55:36 +00:00

36 lines
1.3 KiB
TypeScript

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 hasCorsError = errors.some(err =>
err.includes('CORS') ||
err.includes('Failed to fetch') ||
err.includes('프록시 사용시 정상 작동') ||
err.includes('프록시를 활성화')
);
if (!hasCorsError || errors.length === 0) return null;
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">CORS </AlertTitle>
<AlertDescription className="text-amber-700 text-xs">
<p>HTTP URL에 .</p>
<ul className="list-disc pl-4 mt-1">
<li className="mt-1">CORS .</li>
<li className="mt-1"> HTTPS URL로 .</li>
</ul>
</AlertDescription>
</Alert>
);
};
export default ProxyRecommendationAlert;