page adn app header mods
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
* Consistent with Keywords page layout, structure and design
|
||||
*/
|
||||
|
||||
import { useState, useEffect, useMemo, useCallback, useRef } from 'react';
|
||||
import { useState, useEffect, useCallback, useRef } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import TablePageTemplate from '../../templates/TablePageTemplate';
|
||||
import {
|
||||
fetchTasks,
|
||||
@@ -30,7 +31,7 @@ import { useSectorStore } from '../../store/sectorStore';
|
||||
import { usePageSizeStore } from '../../store/pageSizeStore';
|
||||
import PageHeader from '../../components/common/PageHeader';
|
||||
import ModuleMetricsFooter, { MetricItem, ProgressMetric } from '../../components/dashboard/ModuleMetricsFooter';
|
||||
import { WorkflowInsight } from '../../components/common/WorkflowInsights';
|
||||
import { DocumentTextIcon } from '@heroicons/react/24/outline';
|
||||
|
||||
export default function Tasks() {
|
||||
const toast = useToast();
|
||||
@@ -79,63 +80,6 @@ export default function Tasks() {
|
||||
// Progress modal for AI functions
|
||||
const progressModal = useProgressModal();
|
||||
|
||||
// Calculate workflow insights
|
||||
const workflowInsights: WorkflowInsight[] = useMemo(() => {
|
||||
const insights: WorkflowInsight[] = [];
|
||||
const queuedCount = tasks.filter(t => t.status === 'queued').length;
|
||||
const processingCount = tasks.filter(t => t.status === 'in_progress').length;
|
||||
const completedCount = tasks.filter(t => t.status === 'completed').length;
|
||||
const failedCount = tasks.filter(t => t.status === 'failed').length;
|
||||
const completionRate = totalCount > 0 ? Math.round((completedCount / totalCount) * 100) : 0;
|
||||
|
||||
if (totalCount === 0) {
|
||||
insights.push({
|
||||
type: 'info',
|
||||
message: 'No tasks yet - Queue ideas from Planner to start generating content automatically',
|
||||
});
|
||||
return insights;
|
||||
}
|
||||
|
||||
// Queue status
|
||||
if (queuedCount > 10) {
|
||||
insights.push({
|
||||
type: 'warning',
|
||||
message: `Large queue detected (${queuedCount} tasks) - Content generation may take time, consider prioritizing`,
|
||||
});
|
||||
} else if (queuedCount > 0) {
|
||||
insights.push({
|
||||
type: 'info',
|
||||
message: `${queuedCount} tasks in queue - Content generation pipeline is active`,
|
||||
});
|
||||
}
|
||||
|
||||
// Processing status
|
||||
if (processingCount > 0) {
|
||||
insights.push({
|
||||
type: 'action',
|
||||
message: `${processingCount} tasks actively generating content - Check back soon for completed drafts`,
|
||||
});
|
||||
}
|
||||
|
||||
// Failed tasks
|
||||
if (failedCount > 0) {
|
||||
insights.push({
|
||||
type: 'warning',
|
||||
message: `${failedCount} tasks failed - Review errors and retry or adjust task parameters`,
|
||||
});
|
||||
}
|
||||
|
||||
// Completion success
|
||||
if (completionRate >= 70 && completedCount >= 5) {
|
||||
insights.push({
|
||||
type: 'success',
|
||||
message: `High completion rate (${completionRate}%) - ${completedCount} pieces of content ready for review`,
|
||||
});
|
||||
}
|
||||
|
||||
return insights;
|
||||
}, [tasks, totalCount]);
|
||||
|
||||
// AI Function Logs state
|
||||
|
||||
|
||||
@@ -424,11 +368,21 @@ export default function Tasks() {
|
||||
return (
|
||||
<>
|
||||
<PageHeader
|
||||
title="Content Queue"
|
||||
description="Manage content tasks waiting for AI generation. Queue ideas here to create articles automatically."
|
||||
badge={{ icon: <TaskIcon />, color: 'indigo' }}
|
||||
breadcrumb="Writer / Queue"
|
||||
workflowInsights={workflowInsights}
|
||||
title="Queue"
|
||||
description="Content writing queue"
|
||||
badge={{ icon: <DocumentTextIcon />, color: 'blue' }}
|
||||
breadcrumb="Writer"
|
||||
actions={
|
||||
<Link
|
||||
to="/writer/content"
|
||||
className="inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium text-white bg-brand-500 hover:bg-brand-600 rounded-lg transition-colors"
|
||||
>
|
||||
View Drafts
|
||||
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
|
||||
</svg>
|
||||
</Link>
|
||||
}
|
||||
/>
|
||||
<TablePageTemplate
|
||||
columns={pageConfig.columns}
|
||||
|
||||
Reference in New Issue
Block a user