"use client"; import { LogOut } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Skeleton } from "@/components/ui/skeleton"; import { useUserProfile } from "@/lib/hooks"; import { clearAuthToken } from "@/lib/api"; interface ProfilePageProps { params: Promise<{ locale: string }>; } export default function ClientProfilePage(props: ProfilePageProps) { const { data: user, isLoading, error } = useUserProfile(); const translations = { profile: "Профиль", personalInfo: "Личная информация", profileDescription: "Ваши данные профиля", firstName: "Имя", lastName: "Фамилия", phone: "Номер телефона", address: "Адрес", logout: "Выйти", loading: "Загрузка...", errorLoading: "Не удалось загрузить профиль", tryAgain: "Попробовать снова", }; const handleLogout = () => { clearAuthToken(); window.location.href = "/"; }; if (isLoading) { return (
{[1, 2, 3, 4].map((i) => (
))}
); } if (error) { return (

{translations.errorLoading}

); } return (

{translations.profile}

{translations.personalInfo} {translations.profileDescription} {user && ( <>
)}
); }