diff --git a/src/app/[name]/(Profile)/profile/page.tsx b/src/app/[name]/(Profile)/profile/page.tsx index 64378d3..fe0c66b 100644 --- a/src/app/[name]/(Profile)/profile/page.tsx +++ b/src/app/[name]/(Profile)/profile/page.tsx @@ -3,27 +3,32 @@ import Button from '@/components/button/PrimaryButton'; // import { useProfile } from '@/hooks/auth/useProfile'; // import { useAuthStore } from '@/zustand/authStore'; -import { ArrowLeft, Calendar2, CallCalling, Profile, Sms, Verify } from 'iconsax-react'; +import { ArrowLeft, Calendar2, CallCalling, Profile } from 'iconsax-react'; import Image from 'next/image'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import React from 'react' +import { useGetProfile } from './hooks/userProfileData'; type Props = object function ProfileIndex({ }: Props) { + const router = useRouter(); + const { data, isPending } = useGetProfile(); - // const isAuthenticated = useAuthStore((state) => state.isAuthenticated); + const formatDate = (dateString: string): string => { + const date = new Date(dateString); + return date.toLocaleDateString('fa-IR', { + year: 'numeric', + month: 'numeric', + day: 'numeric' + }); + }; - // const { mutate, data, isPending } = useProfile(); - - // useEffect(() => { - // if (isAuthenticated) { - // mutate(); - // } - // // eslint-disable-next-line react-hooks/exhaustive-deps - // }, [isAuthenticated]) + const userData = data?.data; + const fullName = userData ? `${userData.firstName} ${userData.lastName}` : ''; + const genderText = userData?.gender ? 'آقا' : 'خانوم'; return (