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:
@@ -6,7 +6,7 @@ import { optimizerApi } from '../../api/optimizer.api';
|
||||
import { fetchContent, Content as ContentType } from '../../services/api';
|
||||
import { useToast } from '../../components/ui/toast/ToastContainer';
|
||||
import { OptimizationScores } from '../../components/optimizer/OptimizationScores';
|
||||
import { Loader2, ArrowLeft } from 'lucide-react';
|
||||
import { ArrowLeftIcon, BoltIcon } from '../../icons';
|
||||
|
||||
export default function AnalysisPreview() {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
@@ -63,19 +63,26 @@ export default function AnalysisPreview() {
|
||||
<PageMeta title="Content Analysis" description="Preview content optimization scores" />
|
||||
|
||||
<div className="space-y-6">
|
||||
<PageHeader
|
||||
title="Content Analysis"
|
||||
description="Preview optimization scores without optimizing"
|
||||
actions={
|
||||
<button
|
||||
onClick={() => navigate(-1)}
|
||||
className="inline-flex items-center gap-2 px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors"
|
||||
>
|
||||
<ArrowLeft className="w-4 h-4" />
|
||||
Back
|
||||
</button>
|
||||
}
|
||||
/>
|
||||
<div className="flex items-center justify-between mb-6">
|
||||
<PageHeader
|
||||
title="Content Analysis"
|
||||
lastUpdated={new Date()}
|
||||
badge={{
|
||||
icon: <BoltIcon />,
|
||||
color: 'orange',
|
||||
}}
|
||||
/>
|
||||
<button
|
||||
onClick={() => navigate(-1)}
|
||||
className="inline-flex items-center gap-2 px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors"
|
||||
>
|
||||
<ArrowLeftIcon className="w-4 h-4" />
|
||||
Back
|
||||
</button>
|
||||
</div>
|
||||
<p className="text-gray-600 dark:text-gray-400 mb-6">
|
||||
Preview optimization scores without optimizing
|
||||
</p>
|
||||
|
||||
{loading || analyzing ? (
|
||||
<div className="text-center py-12">
|
||||
|
||||
@@ -9,7 +9,7 @@ import { SourceBadge, ContentSource } from '../../components/content/SourceBadge
|
||||
import { SyncStatusBadge, SyncStatus } from '../../components/content/SyncStatusBadge';
|
||||
import { ContentFilter, FilterState } from '../../components/content/ContentFilter';
|
||||
import { OptimizationScores } from '../../components/optimizer/OptimizationScores';
|
||||
import { Zap, Loader2, CheckCircle2 } from 'lucide-react';
|
||||
import { BoltIcon, CheckCircleIcon } from '../../icons';
|
||||
import { useSectorStore } from '../../store/sectorStore';
|
||||
import { usePageSizeStore } from '../../store/pageSizeStore';
|
||||
|
||||
@@ -146,42 +146,49 @@ export default function OptimizerContentSelector() {
|
||||
<PageMeta title="Optimize Content" description="Select and optimize content for SEO and engagement" />
|
||||
|
||||
<div className="space-y-6">
|
||||
<PageHeader
|
||||
title="Optimize Content"
|
||||
description="Select content to optimize for SEO, readability, and engagement"
|
||||
actions={
|
||||
<div className="flex items-center gap-4">
|
||||
<select
|
||||
value={entryPoint}
|
||||
onChange={(e) => setEntryPoint(e.target.value as EntryPoint)}
|
||||
className="px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white"
|
||||
>
|
||||
<option value="auto">Auto-detect</option>
|
||||
<option value="writer">From Writer</option>
|
||||
<option value="wordpress">From WordPress</option>
|
||||
<option value="external">From External</option>
|
||||
<option value="manual">Manual</option>
|
||||
</select>
|
||||
<button
|
||||
onClick={handleBatchOptimize}
|
||||
disabled={selectedIds.length === 0 || processing.length > 0}
|
||||
className="inline-flex items-center gap-2 px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
|
||||
>
|
||||
{processing.length > 0 ? (
|
||||
<>
|
||||
<Loader2 className="w-4 h-4 animate-spin" />
|
||||
Optimizing...
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Zap className="w-4 h-4" />
|
||||
Optimize Selected ({selectedIds.length})
|
||||
</>
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
<div className="flex items-center justify-between mb-6">
|
||||
<PageHeader
|
||||
title="Optimize Content"
|
||||
lastUpdated={new Date()}
|
||||
badge={{
|
||||
icon: <BoltIcon />,
|
||||
color: 'orange',
|
||||
}}
|
||||
/>
|
||||
<div className="flex items-center gap-4">
|
||||
<select
|
||||
value={entryPoint}
|
||||
onChange={(e) => setEntryPoint(e.target.value as EntryPoint)}
|
||||
className="px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white"
|
||||
>
|
||||
<option value="auto">Auto-detect</option>
|
||||
<option value="writer">From Writer</option>
|
||||
<option value="wordpress">From WordPress</option>
|
||||
<option value="external">From External</option>
|
||||
<option value="manual">Manual</option>
|
||||
</select>
|
||||
<button
|
||||
onClick={handleBatchOptimize}
|
||||
disabled={selectedIds.length === 0 || processing.length > 0}
|
||||
className="inline-flex items-center gap-2 px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
|
||||
>
|
||||
{processing.length > 0 ? (
|
||||
<>
|
||||
<div className="w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin" />
|
||||
Optimizing...
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<BoltIcon className="w-4 h-4" />
|
||||
Optimize Selected ({selectedIds.length})
|
||||
</>
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<p className="text-gray-600 dark:text-gray-400 mb-6">
|
||||
Select content to optimize for SEO, readability, and engagement
|
||||
</p>
|
||||
|
||||
{/* Filters */}
|
||||
<ContentFilter onFilterChange={setFilters} />
|
||||
@@ -275,12 +282,12 @@ export default function OptimizerContentSelector() {
|
||||
>
|
||||
{isProcessing ? (
|
||||
<>
|
||||
<Loader2 className="w-4 h-4 animate-spin" />
|
||||
<div className="w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin" />
|
||||
Optimizing...
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Zap className="w-4 h-4" />
|
||||
<BoltIcon className="w-4 h-4" />
|
||||
Optimize
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user