From 0616faffe17c511a1787f34003d36cd89bb7444d Mon Sep 17 00:00:00 2001 From: sazzadulalambd Date: Sun, 26 Apr 2026 18:41:54 +0600 Subject: [PATCH] refactor: replace Master Data tab with standalone KYC Documents tab in company settings --- src/app/admin/settings/page.tsx | 111 +++++++++----------------------- 1 file changed, 30 insertions(+), 81 deletions(-) diff --git a/src/app/admin/settings/page.tsx b/src/app/admin/settings/page.tsx index 641f181..1759bba 100644 --- a/src/app/admin/settings/page.tsx +++ b/src/app/admin/settings/page.tsx @@ -251,8 +251,8 @@ const initialSettings: CompanySettings = { export default function CompanySettingsPage() { const [settings, setSettings] = useState(initialSettings); - const [activeTab, setActiveTab] = useState<'general' | 'branding' | 'social' | 'integration' | 'landing' | 'master' | 'rental'>('general'); - const [activeMasterTab, setActiveMasterTab] = useState<'kyc' | 'investor' | 'merchant' | 'swapstation' | 'rental' | 'plans' | 'parts' | 'service'>('kyc'); + const [activeTab, setActiveTab] = useState<'general' | 'branding' | 'social' | 'integration' | 'landing' | 'kyc' | 'rental'>('general'); + const [activeMasterTab, setActiveMasterTab] = useState<'investor' | 'merchant' | 'swapstation' | 'rental'>('investor'); const [saved, setSaved] = useState(false); const handleSave = () => { @@ -266,7 +266,8 @@ export default function CompanySettingsPage() { { id: 'social', label: 'Social Media', icon: Link2 }, { id: 'integration', label: 'Integrations', icon: Mail }, { id: 'landing', label: 'Landing Page', icon: Monitor }, - { id: 'master', label: 'Master Data', icon: Package }, + + { id: 'kyc', label: 'KYC Documents', icon: Package }, { id: 'rental', label: 'Rental Policy', icon: FileCheck }, ]; @@ -277,7 +278,7 @@ export default function CompanySettingsPage() {

Company Settings

Manage your company information and configurations

- @@ -725,7 +724,7 @@ export default function CompanySettingsPage() {

SMS Integration

- +
@@ -773,7 +772,7 @@ export default function CompanySettingsPage() { {activeTab === 'landing' && (

Landing Page Hero Section

- +
@@ -841,7 +840,7 @@ export default function CompanySettingsPage() {

{settings.heroData.title}

{settings.heroData.subtitle}

-
)} - {activeTab === 'master' && ( + {activeTab === 'kyc' && (
-

Master Data

- +

KYC Documents

+
{[ - { id: 'kyc', label: 'KYC Documents' }, { id: 'investor', label: 'Investor' }, { id: 'merchant', label: 'Merchant' }, { id: 'swapstation', label: 'Swap Station' }, { id: 'rental', label: 'Rental Types' }, - { id: 'plans', label: 'Subscription Plans' }, ].map(tab => ( ))}
- {activeMasterTab === 'kyc' && ( -
-

KYC Documents Required

-
- {settings.masterData.kycDocuments.map((doc, i) => ( -
- { - const updated = [...settings.masterData.kycDocuments]; - updated[i].required = e.target.checked; - setSettings({ ...settings, masterData: { ...settings.masterData, kycDocuments: updated } }); - }} - className="w-4 h-4" - /> - {doc.name} - - {doc.required ? 'Required' : 'Optional'} - -
- ))} -
-
- )} - {activeMasterTab === 'investor' && (

Investor Documents

@@ -1026,39 +996,18 @@ export default function CompanySettingsPage() {
))}
+
))}
)} - - {activeMasterTab === 'plans' && ( -
-

Subscription Plans

-
- {settings.masterData.subscriptionPlans.map((plan, i) => ( -
-
- {plan.name} - ৳{plan.price} -
-

{plan.duration} days

-
- {plan.features.map((f, j) => ( - {f} - ))} -
-
- ))} -
-
- )}
)} {activeTab === 'rental' && (

Rental Policy

- +