diff --git a/app/[locale]/login/page.tsx b/app/[locale]/login/page.tsx index b2c229fb..9c29a7f5 100644 --- a/app/[locale]/login/page.tsx +++ b/app/[locale]/login/page.tsx @@ -11,12 +11,13 @@ import { useThemeStore } from "@/stores/theme-store"; import { useShallow } from "zustand/react/shallow"; import { useConfig } from "@/hooks/use-config"; import { cn } from "@/lib/utils"; -import { AlertCircle, Loader2, X, Info, Eye, EyeOff, LogIn, Sun, Moon, Monitor, Check, Shield, Play } from "lucide-react"; +import { AlertCircle, Loader2, X, Info, Eye, EyeOff, LogIn, Sun, Moon, Monitor, Check, Shield, Play, Copy } from "lucide-react"; import { discoverOAuth, type OAuthMetadata } from "@/lib/oauth/discovery"; import { generateCodeVerifier, generateCodeChallenge, generateState } from "@/lib/oauth/pkce"; import { OAUTH_SCOPES } from "@/lib/oauth/tokens"; -const APP_VERSION = "1.4.11"; +const APP_VERSION = process.env.NEXT_PUBLIC_APP_VERSION || "0.0.0"; +const GIT_COMMIT = process.env.NEXT_PUBLIC_GIT_COMMIT || "unknown"; const THEME_OPTIONS = [ { value: "light" as const, icon: Sun, label: "Light" }, @@ -24,6 +25,41 @@ const THEME_OPTIONS = [ { value: "system" as const, icon: Monitor, label: "System" }, ]; +function VersionBadge() { + const [copied, setCopied] = useState(false); + const versionInfo = `Version: ${APP_VERSION}\nBuild: ${GIT_COMMIT}`; + + const handleCopy = () => { + navigator.clipboard.writeText(versionInfo).then(() => { + setCopied(true); + setTimeout(() => setCopied(false), 2000); + }); + }; + + return ( +
+ v{APP_VERSION} +
+Version: {APP_VERSION}
+Build: {GIT_COMMIT}
+- v{APP_VERSION} -
+- v{APP_VERSION} -
+Spam Siege
++ Hover over threats to block them. Let legitimate mail through. Survive {GAME_DURATION} seconds. +
+Fortress Secured
++ Score: {score} +
+Fortress Breached
++ Score: {score} +
+