ai fucntiosn adn otehr atuoamtion fixes
This commit is contained in:
@@ -136,6 +136,10 @@ export const createKeywordsPageConfig = (
|
||||
volumeDropdownRef: React.RefObject<HTMLDivElement | null>;
|
||||
setCurrentPage: (page: number) => void;
|
||||
loadKeywords: () => Promise<void>;
|
||||
// Dynamic filter options
|
||||
countryOptions?: Array<{ value: string; label: string }>;
|
||||
statusOptions?: Array<{ value: string; label: string }>;
|
||||
clusterOptions?: Array<{ value: string; label: string }>;
|
||||
}
|
||||
): KeywordsPageConfig => {
|
||||
const showSectorColumn = !handlers.activeSector; // Show when viewing all sectors
|
||||
@@ -267,8 +271,14 @@ export const createKeywordsPageConfig = (
|
||||
type: 'select',
|
||||
options: [
|
||||
{ value: '', label: 'All Status' },
|
||||
{ value: 'new', label: 'New' },
|
||||
{ value: 'mapped', label: 'Mapped' },
|
||||
// Use dynamic options if available, otherwise show default options
|
||||
...(handlers.statusOptions && handlers.statusOptions.length > 0
|
||||
? handlers.statusOptions
|
||||
: [
|
||||
{ value: 'new', label: 'New' },
|
||||
{ value: 'mapped', label: 'Mapped' },
|
||||
]
|
||||
),
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -277,13 +287,19 @@ export const createKeywordsPageConfig = (
|
||||
type: 'select',
|
||||
options: [
|
||||
{ value: '', label: 'All Countries' },
|
||||
{ value: 'US', label: 'United States' },
|
||||
{ value: 'CA', label: 'Canada' },
|
||||
{ value: 'GB', label: 'United Kingdom' },
|
||||
{ value: 'AE', label: 'United Arab Emirates' },
|
||||
{ value: 'AU', label: 'Australia' },
|
||||
{ value: 'IN', label: 'India' },
|
||||
{ value: 'PK', label: 'Pakistan' },
|
||||
// Use dynamic options if available, otherwise show default options
|
||||
...(handlers.countryOptions && handlers.countryOptions.length > 0
|
||||
? handlers.countryOptions
|
||||
: [
|
||||
{ value: 'US', label: 'United States' },
|
||||
{ value: 'CA', label: 'Canada' },
|
||||
{ value: 'GB', label: 'United Kingdom' },
|
||||
{ value: 'AE', label: 'United Arab Emirates' },
|
||||
{ value: 'AU', label: 'Australia' },
|
||||
{ value: 'IN', label: 'India' },
|
||||
{ value: 'PK', label: 'Pakistan' },
|
||||
]
|
||||
),
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -299,6 +315,20 @@ export const createKeywordsPageConfig = (
|
||||
{ value: '5', label: '5 - Very Hard' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'cluster',
|
||||
label: 'Cluster',
|
||||
type: 'select',
|
||||
dynamicOptions: 'clusters', // Flag for dynamic option loading
|
||||
options: [
|
||||
{ value: '', label: 'All Clusters' },
|
||||
// Use dynamic cluster options if available
|
||||
...(handlers.clusterOptions && handlers.clusterOptions.length > 0
|
||||
? handlers.clusterOptions
|
||||
: handlers.clusters.map(c => ({ value: String(c.id), label: c.name }))
|
||||
),
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'volume',
|
||||
label: 'Volume Range',
|
||||
|
||||
Reference in New Issue
Block a user