Refactor frontend components to use new icon imports and improve default values

- Updated `EnhancedMetricCard` to set a default accent color to blue.
- Replaced `lucide-react` icons with custom icons in `LinkResults`, `OptimizationScores`, and various pages in the Automation and Optimizer sections.
- Enhanced button layouts in `AutomationRules`, `Tasks`, and `ContentSelector` for better alignment and user experience.
- Improved loading indicators across components for a more consistent UI experience.
This commit is contained in:
IGNY8 VPS (Salman)
2025-11-17 21:38:08 +00:00
parent 0818dfe385
commit ee56f9bbac
11 changed files with 153 additions and 125 deletions

View File

@@ -4,7 +4,7 @@ import PageMeta from '../../components/common/PageMeta';
import ComponentCard from '../../components/common/ComponentCard';
import EnhancedMetricCard from '../../components/dashboard/EnhancedMetricCard';
import PageHeader from '../../components/common/PageHeader';
import { Zap, FileText, TrendingUp, ArrowRight } from 'lucide-react';
import { BoltIcon, FileTextIcon, ArrowUpIcon, ArrowRightIcon } from '../../icons';
import { fetchContent } from '../../services/api';
import { useSiteStore } from '../../store/siteStore';
import { useSectorStore } from '../../store/sectorStore';
@@ -69,19 +69,26 @@ export default function OptimizerDashboard() {
<PageMeta title="Optimizer Dashboard" description="Content optimization overview and statistics" />
<div className="space-y-6">
<PageHeader
title="Optimizer Dashboard"
description="Optimize your content for SEO, readability, and engagement"
actions={
<Link
to="/optimizer/content"
className="inline-flex items-center gap-2 px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors"
>
<Zap className="w-4 h-4" />
Optimize Content
</Link>
}
/>
<div className="flex items-center justify-between mb-6">
<PageHeader
title="Optimizer Dashboard"
lastUpdated={new Date()}
badge={{
icon: <BoltIcon />,
color: 'orange',
}}
/>
<Link
to="/optimizer/content"
className="inline-flex items-center gap-2 px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors"
>
<BoltIcon />
Optimize Content
</Link>
</div>
<p className="text-gray-600 dark:text-gray-400 mb-6">
Optimize your content for SEO, readability, and engagement
</p>
{loading ? (
<div className="text-center py-12">
@@ -96,8 +103,8 @@ export default function OptimizerDashboard() {
title="Total Optimized"
value={stats.totalOptimized.toString()}
subtitle={`${stats.contentWithoutScores} not optimized`}
icon={<FileText className="w-6 h-6" />}
trend={null}
icon={<FileTextIcon className="w-6 h-6" />}
accentColor="blue"
onClick={() => navigate('/optimizer/content')}
/>
@@ -105,8 +112,8 @@ export default function OptimizerDashboard() {
title="Avg Score Improvement"
value={`+${stats.averageScoreImprovement}%`}
subtitle="Average improvement per optimization"
icon={<TrendingUp className="w-6 h-6" />}
trend={null}
icon={<ArrowUpIcon className="w-6 h-6" />}
accentColor="green"
onClick={() => navigate('/optimizer/content')}
/>
@@ -114,8 +121,8 @@ export default function OptimizerDashboard() {
title="Credits Used"
value={stats.totalCreditsUsed.toString()}
subtitle="Total credits for optimization"
icon={<Zap className="w-6 h-6" />}
trend={null}
icon={<BoltIcon className="w-6 h-6" />}
accentColor="orange"
onClick={() => navigate('/optimizer/content')}
/>
</div>
@@ -128,13 +135,13 @@ export default function OptimizerDashboard() {
className="flex items-center justify-between p-4 border border-gray-200 dark:border-gray-700 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors"
>
<div className="flex items-center gap-3">
<Zap className="w-5 h-5 text-yellow-500" />
<BoltIcon className="w-5 h-5 text-yellow-500" />
<div>
<h3 className="font-medium text-gray-900 dark:text-white">Optimize Content</h3>
<p className="text-sm text-gray-500 dark:text-gray-400">Select and optimize content items</p>
</div>
</div>
<ArrowRight className="w-5 h-5 text-gray-400" />
<ArrowRightIcon className="w-5 h-5 text-gray-400" />
</Link>
<Link
@@ -142,13 +149,13 @@ export default function OptimizerDashboard() {
className="flex items-center justify-between p-4 border border-gray-200 dark:border-gray-700 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors"
>
<div className="flex items-center gap-3">
<FileText className="w-5 h-5 text-purple-500" />
<FileTextIcon className="w-5 h-5 text-purple-500" />
<div>
<h3 className="font-medium text-gray-900 dark:text-white">View Content</h3>
<p className="text-sm text-gray-500 dark:text-gray-400">Browse all content items</p>
</div>
</div>
<ArrowRight className="w-5 h-5 text-gray-400" />
<ArrowRightIcon className="w-5 h-5 text-gray-400" />
</Link>
</div>
</ComponentCard>