mpre ui fixes

This commit is contained in:
IGNY8 VPS (Salman)
2025-12-27 08:00:09 +00:00
parent 4482d2f4c4
commit 034c640601
17 changed files with 352 additions and 158 deletions

View File

@@ -59,7 +59,7 @@ export function createApprovedPageConfig(params: {
const columns: ColumnConfig[] = [
{
key: 'title',
label: 'Title',
label: 'Content Idea Title',
sortable: true,
sortField: 'title',
render: (value: string, row: Content) => (
@@ -92,7 +92,7 @@ export function createApprovedPageConfig(params: {
},
{
key: 'wordpress_status',
label: 'Site Status',
label: 'Site Content Status',
sortable: false,
width: '120px',
render: (_value: any, row: Content) => {

View File

@@ -127,7 +127,7 @@ export const createClustersPageConfig = (
}] : []),
{
key: 'keywords_count',
label: 'Keywords',
label: 'KW Count',
sortable: true,
sortField: 'keywords_count',
width: '120px',
@@ -141,17 +141,7 @@ export const createClustersPageConfig = (
sortField: 'ideas_count',
width: '120px',
align: 'center' as const,
render: (value: number) => (
<Badge
color={value > 0 ? 'success' : 'light'}
size="xs"
variant="soft"
>
<span className="text-[11px] font-normal">
{value > 0 ? `${value.toLocaleString()} ideas` : 'No ideas'}
</span>
</Badge>
),
render: (value: number) => value.toLocaleString(),
},
{
key: 'volume',
@@ -244,7 +234,7 @@ export const createClustersPageConfig = (
},
{
key: 'updated_at',
label: 'Updated',
label: 'Modified',
sortable: false, // Backend doesn't support sorting by updated_at
sortField: 'updated_at',
defaultVisible: false,
@@ -253,7 +243,7 @@ export const createClustersPageConfig = (
// Generate Ideas action column - only shows button for status = 'new'
{
key: 'generate_action',
label: 'Actions',
label: 'Generate Ideas',
sortable: false,
width: '120px',
render: (_value: any, row: Cluster) => {

View File

@@ -97,6 +97,7 @@ export const createContentPageConfig = (
columns: [
{
...titleColumn,
label: 'Content Idea Title',
sortable: true,
sortField: 'title',
render: (value: string, row: Content) => (
@@ -385,7 +386,7 @@ export const createContentPageConfig = (
// Optional columns - hidden by default
{
key: 'updated_at',
label: 'Updated',
label: 'Modified',
sortable: true,
sortField: 'updated_at',
defaultVisible: false,

View File

@@ -95,7 +95,7 @@ export const createIdeasPageConfig = (
{
...titleColumn,
key: 'idea_title',
label: 'Title',
label: 'Content Idea Title',
sortable: true,
sortField: 'idea_title',
toggleable: true, // Enable toggle for this column
@@ -150,7 +150,7 @@ export const createIdeasPageConfig = (
},
{
key: 'target_keywords',
label: 'Target Keywords',
label: 'Keywords',
sortable: false,
width: '250px',
render: (value: string) => (
@@ -215,7 +215,7 @@ export const createIdeasPageConfig = (
// Optional columns - hidden by default
{
key: 'updated_at',
label: 'Updated',
label: 'Modified',
sortable: false, // Backend doesn't support sorting by updated_at
sortField: 'updated_at',
defaultVisible: false,

View File

@@ -245,56 +245,11 @@ export const createKeywordsPageConfig = (
},
{
...createdColumn,
label: 'Added',
sortable: true,
sortField: 'created_at',
render: (value: string) => formatRelativeDate(value),
},
// Optional columns - hidden by default
{
key: 'updated_at',
label: 'Updated',
sortable: true,
sortField: 'updated_at',
defaultVisible: false,
render: (value: string) => formatRelativeDate(value),
},
{
key: 'volume_override',
label: 'Volume Override',
sortable: true,
sortField: 'volume_override',
defaultVisible: false,
render: (value: number | null) => value ? value.toLocaleString() : '-',
},
{
key: 'difficulty_override',
label: 'Difficulty Override',
sortable: true,
sortField: 'difficulty_override',
defaultVisible: false,
align: 'center' as const,
render: (value: number | null) => {
if (value === null || value === undefined) return '-';
const difficultyNum = getDifficultyNumber(value);
return typeof difficultyNum === 'number' ? (
<Badge
color={
difficultyNum === 1 || difficultyNum === 2
? 'success'
: difficultyNum === 3
? 'warning'
: 'error'
}
variant={difficultyNum === 5 ? 'solid' : 'light'}
size="sm"
>
{difficultyNum}
</Badge>
) : (
difficultyNum
);
},
},
],
filters: [
{

View File

@@ -59,7 +59,7 @@ export function createReviewPageConfig(params: {
const columns: ColumnConfig[] = [
{
key: 'title',
label: 'Title',
label: 'Content Idea Title',
sortable: true,
sortField: 'title',
render: (value: string, row: Content) => (

View File

@@ -101,6 +101,7 @@ export const createTasksPageConfig = (
columns: [
{
...titleColumn,
label: 'Content Idea Title',
sortable: true,
sortField: 'title',
toggleable: true,
@@ -295,7 +296,7 @@ export const createTasksPageConfig = (
},
{
key: 'updated_at',
label: 'Updated',
label: 'Modified',
sortable: true,
sortField: 'updated_at',
defaultVisible: false,