[AI] initial commit

This commit is contained in:
2026-04-19 17:15:50 +07:00
commit b03d8cf556
26 changed files with 6933 additions and 0 deletions
+118
View File
@@ -0,0 +1,118 @@
// frontend/src/Profile.tsx
import { useEffect, useState } from "react";
import { motion } from "framer-motion";
import { Shield, Zap, Key, Copy, CreditCard, Loader2 } from "lucide-react";
import { fetchProfile } from "./api";
export default function Profile() {
const [user, setUser] = useState<any>(null);
const [loading, setLoading] = useState(true);
useEffect(() => {
fetchProfile()
.then(setUser)
.catch(console.error)
.finally(() => setLoading(false));
}, []);
if (loading) {
return (
<div className="min-h-screen flex flex-col items-center justify-center text-primary">
<Loader2 className="w-12 h-12 animate-spin mb-4" />
<p className="tracking-[0.3em] uppercase text-sm animate-pulse">
Decrypting_Profile...
</p>
</div>
);
}
if (!user) return null;
const copyRef = () => {
navigator.clipboard.writeText(
`https://t.me/netrunner_vpn_bot?start=${user.tg_id}`,
);
alert("Copied to clipboard!");
};
return (
<div className="min-h-screen p-4 sm:p-6 max-w-2xl mx-auto pb-20">
<header className="mb-8 text-center pt-8">
<div className="inline-flex items-center gap-2 px-4 py-1.5 rounded-full border border-primary/30 bg-primary/10 text-primary text-xs font-bold uppercase tracking-widest mb-4">
<Shield className="w-4 h-4" /> Secure Session Active
</div>
<h1 className="text-3xl font-black tracking-tight">DATA VAULT</h1>
</header>
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
className="grid gap-6"
>
{/* Balance & Status Card */}
<div className="bg-card/40 backdrop-blur-xl border border-border/50 rounded-3xl p-6 shadow-lg">
<div className="flex justify-between items-start mb-6">
<div>
<p className="text-muted-foreground text-xs uppercase tracking-widest mb-1">
Operative ID
</p>
<p className="text-sm font-bold opacity-80">
{user.id.split("-")[0]}...{user.id.split("-")[4]}
</p>
</div>
<div className="text-right">
<p className="text-muted-foreground text-xs uppercase tracking-widest mb-1">
Balance
</p>
<p className="text-2xl font-black text-secondary drop-shadow-[0_0_10px_rgba(0,229,242,0.5)]">
{user.balance} <span className="text-sm">NRXP</span>
</p>
</div>
</div>
</div>
{/* Subscription & Keys */}
<div className="grid grid-cols-2 gap-4">
<button className="bg-primary/10 border border-primary/30 hover:bg-primary/20 transition-colors rounded-3xl p-6 flex flex-col items-center justify-center text-center gap-3 group">
<CreditCard className="w-8 h-8 text-primary group-hover:scale-110 transition-transform" />
<div>
<p className="font-bold text-sm">Uplink Status</p>
<p className="text-xs text-muted-foreground mt-1">
Manage Subscription
</p>
</div>
</button>
<button className="bg-card/40 border border-border/50 hover:border-secondary/50 transition-colors rounded-3xl p-6 flex flex-col items-center justify-center text-center gap-3 group">
<Key className="w-8 h-8 text-secondary group-hover:scale-110 transition-transform" />
<div>
<p className="font-bold text-sm">Access Keys</p>
<p className="text-xs text-muted-foreground mt-1">
Download Configs
</p>
</div>
</button>
</div>
{/* Referral Program */}
<div className="bg-card/40 backdrop-blur-xl border border-border/50 rounded-3xl p-6 relative overflow-hidden group">
<Zap className="absolute -right-4 -bottom-4 w-32 h-32 text-secondary opacity-5 group-hover:opacity-10 transition-opacity" />
<h3 className="font-bold text-lg mb-2">Referral Network</h3>
<p className="text-sm text-muted-foreground mb-4 max-w-[80%]">
Invite operatives to the network. Earn 100 NRXP for each successful
uplink initialization.
</p>
<button
onClick={copyRef}
className="w-full bg-background border border-border/50 hover:border-secondary/50 flex items-center justify-between p-4 rounded-2xl transition-colors"
>
<span className="text-xs text-muted-foreground truncate mr-4">
https://t.me/netrunner_vpn_bot?start={user.tg_id}
</span>
<Copy className="w-4 h-4 text-secondary shrink-0" />
</button>
</div>
</motion.div>
</div>
);
}