import React, { useState, useEffect } from 'react'; // Import components and hooks import { useSEO } from '../hooks/useSEO'; import { useNavigate } from 'react-router-dom'; import { useAuthStore } from '../stores/authStore'; // Import custom components import ShareableImage from '../components/ShareableImage'; const Profile: React.FC = () => { const navigate = useNavigate(); const [loading, setLoading] = useState(true); const { user, userData, isAuthenticated } = useAuthStore(); // SEO optimization for Profile page useSEO({ title: 'My Profile - AiFigure | Manage Your AI Action Figure Creations', description: 'View and manage your AI-generated action figures, account settings, and token balance. Track your creative journey with AiFigure\'s AI art generation platform.', keywords: 'AiFigure profile, my AI action figures, account settings, token balance, AI art portfolio, user dashboard, generated images gallery', ogTitle: 'My Profile - AiFigure | Manage Your AI Action Figure Creations', ogDescription: 'View and manage your AI-generated action figures, account settings, and token balance. Track your creative journey with AiFigure.', ogImage: 'https://aifigure.com/profile-og-image.jpg', ogUrl: window.location.href, twitterTitle: 'My Profile - AiFigure | Manage Your AI Action Figure Creations', twitterDescription: 'View and manage your AI-generated action figures, account settings, and token balance. Track your creative journey with AiFigure.', twitterImage: 'https://aifigure.com/profile-og-image.jpg', canonical: window.location.href, type: 'website', }); useEffect(() => { if (!isAuthenticated) { navigate('/auth'); return; } // User data is now managed centrally by the auth store if (userData) { setLoading(false); } }, [isAuthenticated, userData, navigate]); // const getTierInfo = (tier: string) => { // switch (tier) { // case 'free': // return { name: 'Free', color: 'bg-gray-600', monthlyTokens: 25 }; // case 'basic': // return { name: 'Basic', color: 'bg-blue-600', monthlyTokens: 50 }; // case 'pro': // return { name: 'Pro', color: 'bg-purple-600', monthlyTokens: 200 }; // case 'premium': // return { name: 'Premium', color: 'bg-yellow-600', monthlyTokens: 1000 }; // default: // return { name: 'Free', color: 'bg-gray-600', monthlyTokens: 25 }; // } // }; if (loading) { return (
You need to be signed in to view your profile.
Fetching your account information.
{user.email}
{/*Available for AI generation
Start creating amazing action figures!