Refactor Register page components

Splits the Register page into smaller, more manageable components for better organization and maintainability.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-15 13:52:41 +00:00
parent 4a39c61976
commit 09f6f9d5fa
6 changed files with 309 additions and 192 deletions

View File

@@ -0,0 +1,45 @@
import React from "react";
import { RefreshCcw } from "lucide-react";
import { Button } from "@/components/ui/button";
import { Alert, AlertTitle, AlertDescription } from "@/components/ui/alert";
interface ServerStatusAlertProps {
serverStatus: {
checked: boolean;
connected: boolean;
message: string;
};
checkServerConnection: () => Promise<void>;
}
const ServerStatusAlert: React.FC<ServerStatusAlertProps> = ({
serverStatus,
checkServerConnection,
}) => {
if (!serverStatus.checked || serverStatus.connected) {
return null;
}
return (
<Alert variant="destructive" className="mb-6">
<AlertTitle className="flex items-center">
<Button
variant="ghost"
size="sm"
className="ml-2 h-6 w-6 p-0"
onClick={checkServerConnection}
>
<RefreshCcw className="h-4 w-4" />
</Button>
</AlertTitle>
<AlertDescription>
{serverStatus.message}
<p className="mt-1 text-xs"> .</p>
</AlertDescription>
</Alert>
);
};
export default ServerStatusAlert;