diff --git a/src/widgets/cabinet/ui/profile/ProfileForm.tsx b/src/widgets/cabinet/ui/profile/ProfileForm.tsx
index 4737f65..a14f4b8 100644
--- a/src/widgets/cabinet/ui/profile/ProfileForm.tsx
+++ b/src/widgets/cabinet/ui/profile/ProfileForm.tsx
@@ -2,7 +2,6 @@
import React from 'react';
import { User, Phone, Lock, Save, CheckCircle } from 'lucide-react';
import { useProfile } from '../../lib/hooks/useProfile';
-import type { UserProfile } from '../../lib/types';
// ─── Input field ───────────────────────────────────────────────────────────────
@@ -13,6 +12,7 @@ interface InputFieldProps {
type?: string;
icon: React.ElementType;
placeholder?: string;
+ disabled?: boolean;
}
const InputField: React.FC
= ({
@@ -22,6 +22,7 @@ const InputField: React.FC = ({
type = 'text',
icon: Icon,
placeholder,
+ disabled,
}) => (
);
+// ─── Skeleton ──────────────────────────────────────────────────────────────────
+
+const FieldSkeleton = () => (
+
+);
+
// ─── Form ──────────────────────────────────────────────────────────────────────
-interface ProfileFormProps {
- initial: UserProfile;
-}
-
-export const ProfileForm: React.FC = ({ initial }) => {
- const { form, isSaving, saved, handleChange, handleSave } =
- useProfile(initial);
+export const ProfileForm: React.FC = () => {
+ const {
+ form,
+ profile,
+ isLoading,
+ isSaving,
+ saved,
+ handleChange,
+ handleSave,
+ } = useProfile();
return (
@@ -67,27 +82,46 @@ export const ProfileForm: React.FC
= ({ initial }) => {
Shaxsiy ma'lumotlar
- handleChange('name', v)}
- icon={User}
- placeholder="Ali"
- />
- handleChange('surname', v)}
- icon={User}
- placeholder="Karimov"
- />
- handleChange('phone', v)}
- icon={Phone}
- placeholder="+998 90 123 45 67"
- />
+ {isLoading ? (
+ <>
+
+
+
+
+ >
+ ) : (
+ <>
+ handleChange('first_name', v)}
+ icon={User}
+ placeholder="Ali"
+ />
+ handleChange('last_name', v)}
+ icon={User}
+ placeholder="Karimov"
+ />
+ handleChange('phone', v)}
+ icon={Phone}
+ placeholder="+998 90 123 45 67"
+ />
+ {}}
+ icon={User}
+ placeholder="email@example.com"
+ disabled
+ />
+ >
+ )}
@@ -96,27 +130,11 @@ export const ProfileForm: React.FC = ({ initial }) => {
Parol o'zgartirish
-
-
handleChange('currentPassword', v)}
- type="password"
- icon={Lock}
- placeholder="••••••••"
- />
+
handleChange('newPassword', v)}
- type="password"
- icon={Lock}
- placeholder="••••••••"
- />
- handleChange('confirmPassword', v)}
+ value={form.password}
+ onChange={(v) => handleChange('password', v)}
type="password"
icon={Lock}
placeholder="••••••••"
@@ -128,7 +146,7 @@ export const ProfileForm: React.FC = ({ initial }) => {