diff --git a/app/admin/login/page.tsx b/app/admin/login/page.tsx new file mode 100644 index 0000000..c08e558 --- /dev/null +++ b/app/admin/login/page.tsx @@ -0,0 +1,161 @@ +import { AdminShellServer } from "@/components/admin-shell-server"; +import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; +import { + Card, + CardAction, + CardContent, + CardDescription, + CardFooter, + CardHeader, + CardTitle, +} from "@/components/ui/card"; +import { + Tabs, + TabsContent, + TabsList, + TabsTrigger, +} from "@/components/ui/tabs"; +import { ExternalLink, KeyRound } from "lucide-react"; + +export const dynamic = "force-dynamic"; + +type LoginMethodProps = { + name: string; + description: string; + href: string; + configured: boolean; + setupVariables: string[]; + resultVariables: string[]; +}; + +function EnvironmentBlock({ variables }: { variables: string[] }) { + return ( +
+      {variables.map((variable) => `${variable}=\n`).join("")}
+    
+ ); +} + +function LoginMethod({ + name, + description, + href, + configured, + setupVariables, + resultVariables, +}: LoginMethodProps) { + return ( + + + {name} + {description} + + + {configured ? "Ready" : "Setup required"} + + + + +
+

Required before login

+

+ Add these values to the server environment and restart the app. +

+ +
+
+

Returned after login

+

+ The callback page will show these values for your .env file. +

+ +
+
+ + {configured ? ( + + ) : ( + + )} + +
+ ); +} + +export default function AdminLoginPage() { + const youtubeConfigured = Boolean( + process.env.BASE_URL && + process.env.YOUTUBE_CLIENT_ID && + process.env.YOUTUBE_CLIENT_SECRET, + ); + const tiktokConfigured = Boolean( + process.env.BASE_URL && + process.env.TIKTOK_CLIENT_KEY && + process.env.TIKTOK_CLIENT_SECRET, + ); + + return ( + +
+
+

Login

+

+ Authorize a platform account and collect the generated .env values. +

+
+ + + + YouTube + TikTok + + + + + + + + +
+
+ ); +}