@djangocfg/layouts 2.1.57 → 2.1.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,76 +0,0 @@
1
- 'use client';
2
-
3
- import { Github, Loader2 } from 'lucide-react';
4
- import React from 'react';
5
-
6
- import { useGithubAuth } from '@djangocfg/api/auth';
7
- import { Button } from '@djangocfg/ui-nextjs/components';
8
-
9
- import { useAuthContext } from './AuthContext';
10
-
11
- /**
12
- * OAuth Providers Component
13
- *
14
- * Shows OAuth login buttons (GitHub, etc.) when enabled.
15
- * Handles the OAuth flow initiation.
16
- */
17
- export const OAuthProviders: React.FC = () => {
18
- const { enableGithubAuth, sourceUrl, setError } = useAuthContext();
19
-
20
- const {
21
- isLoading: isGithubLoading,
22
- startGithubAuth,
23
- } = useGithubAuth({
24
- sourceUrl,
25
- onError: (error) => {
26
- setError(error);
27
- },
28
- });
29
-
30
- // Don't render if no OAuth providers are enabled
31
- if (!enableGithubAuth) {
32
- return null;
33
- }
34
-
35
- return (
36
- <div className="space-y-4">
37
- {/* Divider */}
38
- <div className="relative">
39
- <div className="absolute inset-0 flex items-center">
40
- <div className="w-full border-t border-border" />
41
- </div>
42
- <div className="relative flex justify-center text-xs uppercase">
43
- <span className="bg-card px-2 text-muted-foreground">
44
- Or continue with
45
- </span>
46
- </div>
47
- </div>
48
-
49
- {/* OAuth Buttons */}
50
- <div className="grid gap-3">
51
- {enableGithubAuth && (
52
- <Button
53
- type="button"
54
- variant="outline"
55
- className="w-full h-11 text-base font-medium"
56
- onClick={startGithubAuth}
57
- disabled={isGithubLoading}
58
- >
59
- {isGithubLoading ? (
60
- <div className="flex items-center gap-2">
61
- <Loader2 className="w-5 h-5 animate-spin" />
62
- Connecting...
63
- </div>
64
- ) : (
65
- <div className="flex items-center gap-2">
66
- <Github className="w-5 h-5" />
67
- Continue with GitHub
68
- </div>
69
- )}
70
- </Button>
71
- )}
72
- </div>
73
-
74
- </div>
75
- );
76
- };