"use client"; import { ExternalLink, AlertTriangle, Loader2 } from "lucide-react"; import { Card, CardContent, CardFooter, Separator, Alert, AlertDescription } from "../../../../shadcnui"; import { OAuthConsentHeader } from "./OAuthConsentHeader"; import { OAuthScopeList } from "./OAuthScopeList"; import { OAuthConsentActions } from "./OAuthConsentActions"; import { useOAuthConsent } from "../../hooks/useOAuthConsent"; import { OAuthConsentRequest } from "../../interfaces/oauth.interface"; export interface OAuthConsentScreenProps { /** OAuth authorization parameters */ params: OAuthConsentRequest; /** Optional platform logo URL */ logoUrl?: string; /** Platform name */ appName?: string; /** Terms of Service URL */ termsUrl?: string; /** Privacy Policy URL */ privacyUrl?: string; } /** * Main OAuth consent screen component * Displays client info, requested scopes, and approve/deny buttons * * @example * ```tsx * * ``` */ export function OAuthConsentScreen({ params, logoUrl, appName = "Only35", termsUrl = "/terms", privacyUrl = "/privacy", }: OAuthConsentScreenProps) { const { clientInfo, isLoading, error, approve, deny, isSubmitting } = useOAuthConsent(params); // Loading state if (isLoading) { return (

Loading authorization request...

); } // Error state if (error || !clientInfo) { return (
{error?.message || "Invalid authorization request. Please try again."}
); } const { client, scopes } = clientInfo; return (
{/* Header */} {/* Scopes */} {/* Redirect URI Notice */}
Authorizing will redirect you to:

{params.redirectUri}

{/* Actions */}
{/* Footer */}

By authorizing, you agree to the app's{" "} Terms of Service {" "} and{" "} Privacy Policy .

); }