Files
zellyy-finance/src/components/auth/ServerStatusAlert.tsx
gpt-engineer-app[bot] 9ff0592e33 Fix import error in App.tsx
Corrected the import path for SupabaseSettings in App.tsx to resolve a module resolution error.
2025-03-15 22:38:05 +00:00

42 lines
1.1 KiB
TypeScript

import React from 'react';
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { AlertCircle, RefreshCw } from "lucide-react";
import { Button } from "@/components/ui/button";
interface ServerStatusAlertProps {
serverStatus: {
checked: boolean;
connected: boolean;
message: string;
};
checkServerConnection: () => Promise<void>;
}
const ServerStatusAlert = ({ serverStatus, checkServerConnection }: ServerStatusAlertProps) => {
if (!serverStatus.checked || serverStatus.connected) {
return null;
}
return (
<Alert variant="destructive" className="mb-6">
<AlertCircle className="h-4 w-4" />
<AlertTitle> </AlertTitle>
<AlertDescription className="flex flex-col">
<span>{serverStatus.message}</span>
<Button
variant="outline"
size="sm"
className="mt-2 self-start flex items-center gap-1"
onClick={checkServerConnection}
>
<RefreshCw className="h-3 w-3" />
<span> </span>
</Button>
</AlertDescription>
</Alert>
);
};
export default ServerStatusAlert;