Files
zellyy-finance/src/components/auth/SupabaseConnectionStatus.tsx
gpt-engineer-app[bot] 1e6d360d69 Fix type error in SupabaseConnectionTest
The TestResults type was not assignable to the TestResult type in the SupabaseConnectionTest component. This commit ensures the types are compatible.
2025-03-15 12:43:46 +00:00

67 lines
2.2 KiB
TypeScript

import React from "react";
import { Link } from "react-router-dom";
import { ArrowRight, Shield } from "lucide-react";
import { TestResults } from "@/lib/supabase/tests/types";
interface TestResultProps {
testResults: TestResults | null;
}
const SupabaseConnectionStatus: React.FC<TestResultProps> = ({ testResults }) => {
if (!testResults) {
return null;
}
return (
<details className="neuro-flat p-3 text-xs mb-4">
<summary className="cursor-pointer text-gray-500 font-medium"> </summary>
<div className="mt-2 space-y-2">
<div>
<p className="font-medium">Supabase URL:</p>
<p className="break-all bg-gray-100 p-1 rounded">{testResults?.url || '알 수 없음'}</p>
</div>
{testResults?.usingProxy && (
<div>
<p className="font-medium">CORS :</p>
<div className="flex items-center gap-1">
<Shield className="h-3 w-3 text-blue-500" />
<p className="break-all text-blue-500"> - {testResults.proxyUrl}</p>
</div>
</div>
)}
<div>
<p className="font-medium"> :</p>
<p>{testResults?.client ? '성공' : '실패'}</p>
</div>
<div>
<p className="font-medium"> :</p>
<p className="break-all">{navigator.userAgent}</p>
</div>
<div>
<p className="font-medium"> :</p>
<p>1.0.0</p>
</div>
{testResults && (
<div className="border-t pt-2 mt-2">
<p>REST API: {testResults.restApi ? '✅' : '❌'}</p>
<p>: {testResults.auth ? '✅' : '❌'}</p>
<p>: {testResults.database ? '✅' : '❌'}</p>
</div>
)}
<div className="text-right pt-1">
<Link
to="/supabase-settings"
className="inline-flex items-center text-neuro-income hover:underline"
>
<span>Supabase </span>
<ArrowRight className="h-3 w-3 ml-1" />
</Link>
</div>
</div>
</details>
);
};
export default SupabaseConnectionStatus;