import React, { useState } from "react"; import { User, Mail, Phone, Calendar, MapPin, CreditCard, Globe, Lock } from "lucide-react"; import { useSelector } from "react-redux"; import { RootState } from "../../store"; import ChangePasswordModal from "./ChangePasswordModal"; const Settings: React.FC = () => { const { profile } = useSelector((state: RootState) => state.profile); const [modalOpen, setModalOpen] = useState(false); const fullName = `${profile?.firstName || ""} ${profile?.lastName || ""}`.trim(); const maskLast5 = (value: string) => { if (!value) return "N/A"; const str = value.toString(); const last5 = str.slice(-5); const masked = "X".repeat(str.length - 5) + last5; return masked; }; return (
{/* Header */}

Profile Settings

{/* Profile Card */}
{/* Compact Avatar Section */}

{fullName || "N/A"}

{profile?.email || "No Email"}

{/* Compact Details Grid */}
{/* Basic Info */}

DOB

{profile?.dob || "N/A"}

🎂 Age

{profile?.age || "N/A"}

{/* Contact Info */}

Phone

{profile?.phone || "N/A"}

💬 Skype

{profile?.skype || "Not Linked"}

{/* Payment Info */}

Payment

{profile?.paymentMethod || "N/A"}

{profile?.paymentMethod === "payoneer" && (

💳 Payoneer

{maskLast5(profile?.payoneerAccount)}

)} {profile?.paymentMethod === "veem" && (

🏦 Veem

{profile?.veemAccount || "N/A"}

)} {/* Location - Full Width */}

Address

{[profile?.address, profile?.city, profile?.state, profile?.country] .filter(Boolean) .join(", ") || "N/A"}

{/* Change Password Modal */} setModalOpen(false)} />
); }; export default Settings;