import { useState, useEffect } from "react"; import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"; import { User } from "@/services/userService"; import { UserProfileDetails } from "./UserProfileDetails"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { ChangePasswordForm } from "./ChangePasswordForm"; import { UpdateProfileForm } from "./UpdateProfileForm"; interface ProfileContentProps { currentUser: User | null; onUserUpdated?: () => Promise; } export function ProfileContent({ currentUser, onUserUpdated }: ProfileContentProps) { const [activeTab, setActiveTab] = useState("details"); // When active tab changes, refresh user data if needed useEffect(() => { if (activeTab === "details" && onUserUpdated) { onUserUpdated(); } }, [activeTab, onUserUpdated]); if (!currentUser) { return ( User Profile Your profile information could not be loaded ); } return (

My Profile

{/* Left column - Profile summary card */} Profile Summary {/* Right column - Profile tabs for edit and password change */} My Account Manage your account settings Profile Details Security Last updated: {new Date(currentUser.updated).toLocaleString()}
); }