import { motion } from "framer-motion";
import { Link } from "wouter";
import { ArrowLeft, CheckCircle2, ShieldCheck, Fingerprint, Loader2 } from "lucide-react";
import { useQuery } from "@tanstack/react-query";
import { useAuth } from "@/lib/auth";
import sealImg from '@assets/generated_images/holographic_digital_security_seal_for_certification.png';
import gridBg from '@assets/generated_images/dark_subtle_digital_grid_texture.png';
export default function Passport() {
const { user } = useAuth();
const { data: profile, isLoading: profileLoading } = useQuery({
queryKey: ["/api/me/profile"],
enabled: !!user
});
const { data: passport, isLoading: passportLoading } = useQuery({
queryKey: ["/api/me/passport"],
enabled: !!user
});
const { data: achievements, isLoading: achievementsLoading } = useQuery({
queryKey: ["/api/me/achievements"],
enabled: !!user
});
const isLoading = profileLoading || passportLoading || achievementsLoading;
if (!user) {
return (
Please log in to view your passport
);
}
return (
{/* Background */}
{isLoading ? (
Loading passport...
) : (
{/* Holographic Overlay Effect */}
{/* Header */}
AeThex Foundry
Architect Credential
{/* Content Grid */}
{/* Left Column: ID Info */}
{passport?.id?.slice(0, 12) || profile?.aethex_passport_id || 'AX-PENDING'}
{profile?.full_name || profile?.username || user.username}
{profile?.role === 'admin' || profile?.role === 'oversee' ? 'Overseer' :
profile?.role === 'architect' ? 'Architect' : 'Member'}
Level {profile?.level || 1}
{profile?.total_xp?.toLocaleString() || 0}
{/* Right Column: Certification */}
Achievements ({achievements?.length || 0})
{achievements && achievements.length > 0 ? (
{achievements.map((item: any, index: number) => (
-
{item.title}
{item.description && (
{item.description}
)}
+{item.xp_reward || 0} XP
))}
) : (
No achievements yet. Keep building!
)}
Immutable Ledger Hash
{'0x7f23b9c02a9'}
Verified by The AeThex Foundry
{/* Footer Bar */}
Official Certification Document - Do Not Copy
)}
);
}