Styles styels styles
This commit is contained in:
@@ -15,7 +15,7 @@ import {
|
||||
clusterColumn,
|
||||
sectorColumn,
|
||||
statusColumn,
|
||||
createdColumn,
|
||||
createdWithActionsColumn,
|
||||
} from '../snippets/columns.snippets';
|
||||
// Icons removed - bulkActions and rowActions are now in table-actions.config.tsx
|
||||
import Badge from '../../components/ui/badge/Badge';
|
||||
@@ -146,13 +146,19 @@ export const createKeywordsPageConfig = (
|
||||
...keywordColumn,
|
||||
sortable: false, // Backend doesn't support sorting by keyword field
|
||||
sortField: 'seed_keyword__keyword',
|
||||
width: '300px',
|
||||
render: (value: string) => (
|
||||
<span>
|
||||
{value || '-'}
|
||||
</span>
|
||||
),
|
||||
},
|
||||
// Sector column - only show when viewing all sectors
|
||||
...(showSectorColumn ? [{
|
||||
...sectorColumn,
|
||||
render: (value: string, row: Keyword) => (
|
||||
<Badge color="info" size="xs" variant="soft">
|
||||
<span className="text-[11px] font-normal">{row.sector_name || '-'}</span>
|
||||
{row.sector_name || '-'}
|
||||
</Badge>
|
||||
),
|
||||
}] : []),
|
||||
@@ -161,16 +167,18 @@ export const createKeywordsPageConfig = (
|
||||
sortable: true,
|
||||
sortField: 'seed_keyword__volume', // Backend expects seed_keyword__volume
|
||||
align: 'center' as const,
|
||||
headingAlign: 'center' as const,
|
||||
render: (value: number) => value.toLocaleString(),
|
||||
},
|
||||
{
|
||||
...clusterColumn,
|
||||
sortable: false, // Backend doesn't support sorting by cluster_id
|
||||
sortField: 'cluster_id',
|
||||
width: '300px',
|
||||
render: (_value: string, row: Keyword) => row.cluster_name ? (
|
||||
<Badge color="info" size="xs" variant="outline">
|
||||
<span className="text-[11px] font-normal">{row.cluster_name}</span>
|
||||
</Badge>
|
||||
<span className="text-gray-800 dark:text-white">
|
||||
{row.cluster_name}
|
||||
</span>
|
||||
) : <span className="text-gray-400">-</span>,
|
||||
},
|
||||
{
|
||||
@@ -178,6 +186,7 @@ export const createKeywordsPageConfig = (
|
||||
sortable: true,
|
||||
sortField: 'seed_keyword__difficulty', // Backend expects seed_keyword__difficulty
|
||||
align: 'center' as const,
|
||||
headingAlign: 'center' as const,
|
||||
render: (value: number) => {
|
||||
const difficultyNum = getDifficultyNumber(value);
|
||||
const difficultyBadgeColor =
|
||||
@@ -194,7 +203,7 @@ export const createKeywordsPageConfig = (
|
||||
: 'gray';
|
||||
return typeof difficultyNum === 'number' ? (
|
||||
<Badge color={difficultyBadgeColor} variant="soft" size="xs">
|
||||
<span className="text-[11px] font-normal">{difficultyNum}</span>
|
||||
{difficultyNum}
|
||||
</Badge>
|
||||
) : (
|
||||
difficultyNum
|
||||
@@ -206,23 +215,12 @@ export const createKeywordsPageConfig = (
|
||||
sortable: false, // Backend doesn't support sorting by country
|
||||
sortField: 'seed_keyword__country',
|
||||
align: 'center' as const,
|
||||
render: (value: string) => {
|
||||
const countryNames: Record<string, string> = {
|
||||
'US': 'United States',
|
||||
'CA': 'Canada',
|
||||
'GB': 'United Kingdom',
|
||||
'AE': 'United Arab Emirates',
|
||||
'AU': 'Australia',
|
||||
'IN': 'India',
|
||||
'PK': 'Pakistan',
|
||||
};
|
||||
const displayName = countryNames[value] || value || '-';
|
||||
return (
|
||||
<Badge color="info" size="xs" variant="soft">
|
||||
<span className="text-[11px] font-normal">{value || '-'}</span>
|
||||
</Badge>
|
||||
);
|
||||
},
|
||||
headingAlign: 'center' as const,
|
||||
render: (value: string) => (
|
||||
<Badge color="info" size="xs" variant="soft">
|
||||
{value || '-'}
|
||||
</Badge>
|
||||
),
|
||||
},
|
||||
{
|
||||
...statusColumn,
|
||||
@@ -242,16 +240,17 @@ export const createKeywordsPageConfig = (
|
||||
size="xs"
|
||||
variant="soft"
|
||||
>
|
||||
<span className="text-[11px] font-normal">{properCase}</span>
|
||||
{properCase}
|
||||
</Badge>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
...createdColumn,
|
||||
...createdWithActionsColumn,
|
||||
label: 'Added',
|
||||
sortable: true,
|
||||
sortField: 'created_at',
|
||||
width: '130px',
|
||||
render: (value: string) => formatRelativeDate(value),
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user