more fixes
This commit is contained in:
@@ -25,7 +25,6 @@ import { useProgressModal } from '../../hooks/useProgressModal';
|
||||
import PageHeader from '../../components/common/PageHeader';
|
||||
import ModuleMetricsFooter, { MetricItem, ProgressMetric } from '../../components/dashboard/ModuleMetricsFooter';
|
||||
import { PencilSquareIcon } from '@heroicons/react/24/outline';
|
||||
import StatusMetricsCard from '../../components/common/StatusMetricsCard';
|
||||
|
||||
export default function Content() {
|
||||
const toast = useToast();
|
||||
@@ -56,22 +55,6 @@ export default function Content() {
|
||||
const progressModal = useProgressModal();
|
||||
const hasReloadedRef = useRef(false);
|
||||
|
||||
// Review count state
|
||||
const [reviewCount, setReviewCount] = useState(0);
|
||||
|
||||
// Load review count
|
||||
useEffect(() => {
|
||||
const loadReviewCount = async () => {
|
||||
try {
|
||||
const data = await fetchContent({ status: 'review', page_size: 1 });
|
||||
setReviewCount(data.count || 0);
|
||||
} catch (error) {
|
||||
console.error('Error fetching review count:', error);
|
||||
}
|
||||
};
|
||||
loadReviewCount();
|
||||
}, []);
|
||||
|
||||
// Load content - wrapped in useCallback
|
||||
const loadContent = useCallback(async () => {
|
||||
setLoading(true);
|
||||
@@ -290,24 +273,6 @@ export default function Content() {
|
||||
onDelete={handleDelete}
|
||||
onBulkDelete={handleBulkDelete}
|
||||
getItemDisplayName={(row: ContentType) => row.title || `Content #${row.id}`}
|
||||
statusExplainer={
|
||||
<StatusMetricsCard
|
||||
title="Content Drafts"
|
||||
color="orange"
|
||||
icon={<PencilSquareIcon className="w-5 h-5" />}
|
||||
count={totalCount}
|
||||
subtitle="draft content items"
|
||||
metrics={[
|
||||
{ label: 'Image Prompts', value: `${content.filter(c => c.has_image_prompts).length}/${content.length}` },
|
||||
{ label: 'Images Generated', value: `${content.filter(c => c.has_generated_images).length}/${content.length}` },
|
||||
]}
|
||||
reviewCount={reviewCount}
|
||||
actionButton={{
|
||||
label: 'Review',
|
||||
href: '/writer/review',
|
||||
}}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Module Metrics Footer - Pipeline Style with Cross-Module Links */}
|
||||
|
||||
Reference in New Issue
Block a user