feat: Introduce shared settings components, implement user settings pages, and refactor agent settings pages to utilize them.

This commit is contained in:
pradeepkumar
2026-01-20 12:37:22 +05:30
parent f035129b6a
commit d325089ce0
17 changed files with 1284 additions and 725 deletions

View File

@@ -0,0 +1,40 @@
'use client';
import { SettingsSidebar, NotificationsForm } from '@/components/settings';
interface NotificationSetting {
id: string;
label: string;
description: string;
enabled: boolean;
}
export default function UserNotificationsPage() {
const handleSave = (data: {
emailNotifications: NotificationSetting[];
pushNotifications: NotificationSetting[];
}) => {
console.log('Saving user notification settings:', data);
};
return (
<div className="max-w-7xl mx-auto px-4 lg:px-8 py-6">
<div className="flex flex-col lg:flex-row gap-6">
{/* Left Sidebar */}
<SettingsSidebar basePath="/user/settings" />
{/* Main Content */}
<div className="flex-1">
{/* Header Card */}
<div className="border border-[#00293d]/10 rounded-[15px] px-6 py-4 mb-4 bg-white">
<h1 className="font-fractul font-bold text-[15px] leading-[18px] text-[#00293D]">
Notifications
</h1>
</div>
<NotificationsForm onSave={handleSave} />
</div>
</div>
</div>
);
}

View File

@@ -0,0 +1,32 @@
'use client';
import { SettingsSidebar, ProfileSettingsForm } from '@/components/settings';
export default function UserProfileSettingsPage() {
const handleSave = (data: {
fullName: string;
career: string;
email: string;
phone: string;
location: string;
}) => {
console.log('Saving user profile settings:', data);
};
return (
<div className="max-w-7xl mx-auto px-4 lg:px-8 py-6">
<div className="flex flex-col lg:flex-row gap-6">
{/* Left Sidebar */}
<SettingsSidebar basePath="/user/settings" />
{/* Main Content */}
<div className="flex-1">
<ProfileSettingsForm
onSave={handleSave}
descriptionText="This information will be displayed on your public profile page."
/>
</div>
</div>
</div>
);
}

View File

@@ -0,0 +1,30 @@
'use client';
import { SettingsSidebar, PasswordSecurityForm } from '@/components/settings';
export default function UserPasswordSecurityPage() {
const handleSave = (data: { currentPassword: string; newPassword: string }) => {
console.log('Updating user password:', data);
};
return (
<div className="max-w-7xl mx-auto px-4 lg:px-8 py-6">
<div className="flex flex-col lg:flex-row gap-6">
{/* Left Sidebar */}
<SettingsSidebar basePath="/user/settings" />
{/* Main Content */}
<div className="flex-1">
{/* Header Card */}
<div className="border border-[#00293d]/10 rounded-[15px] px-6 py-4 mb-4 bg-white">
<h1 className="font-fractul font-bold text-[15px] leading-[18px] text-[#00293D]">
Password Security
</h1>
</div>
<PasswordSecurityForm onSave={handleSave} />
</div>
</div>
</div>
);
}

View File

@@ -0,0 +1,49 @@
'use client';
import { SettingsSidebar, PrivacyForm } from '@/components/settings';
interface PrivacySetting {
id: string;
label: string;
description: string;
value: string;
options: { value: string; label: string }[];
}
export default function UserPrivacyPage() {
const handleSave = (data: {
privacySettings: PrivacySetting[];
dataSettings: {
shareAnalytics: boolean;
personalizedAds: boolean;
thirdPartySharing: boolean;
};
}) => {
console.log('Saving user privacy settings:', data);
};
const handleDeleteAccount = () => {
console.log('User account deletion requested');
};
return (
<div className="max-w-7xl mx-auto px-4 lg:px-8 py-6">
<div className="flex flex-col lg:flex-row gap-6">
{/* Left Sidebar */}
<SettingsSidebar basePath="/user/settings" />
{/* Main Content */}
<div className="flex-1">
{/* Header Card */}
<div className="border border-[#00293d]/10 rounded-[15px] px-6 py-4 mb-4 bg-white">
<h1 className="font-fractul font-bold text-[15px] leading-[18px] text-[#00293D]">
Privacy
</h1>
</div>
<PrivacyForm onSave={handleSave} onDeleteAccount={handleDeleteAccount} />
</div>
</div>
</div>
);
}