bukkl delte conte

This commit is contained in:
IGNY8 VPS (Salman)
2025-12-01 05:42:33 +00:00
parent 6439fc5a3a
commit 54e1238f8a
3 changed files with 46 additions and 0 deletions

View File

@@ -10,6 +10,8 @@ import {
Content as ContentType,
ContentFilters,
generateImagePrompts,
deleteContent,
bulkDeleteContent,
} from '../../services/api';
import { optimizerApi } from '../../api/optimizer.api';
import { useNavigate } from 'react-router';
@@ -210,6 +212,17 @@ export default function Content() {
}
}, [toast, progressModal, loadContent, navigate]);
const handleDelete = useCallback(async (id: number) => {
await deleteContent(id);
loadContent();
}, [loadContent]);
const handleBulkDelete = useCallback(async (ids: number[]) => {
const result = await bulkDeleteContent(ids);
loadContent();
return result;
}, [loadContent]);
// Writer navigation tabs
const writerTabs = [
{ label: 'Tasks', path: '/writer/tasks', icon: <TaskIcon /> },
@@ -265,6 +278,8 @@ export default function Content() {
}}
headerMetrics={headerMetrics}
onRowAction={handleRowAction}
onDelete={handleDelete}
onBulkDelete={handleBulkDelete}
getItemDisplayName={(row: ContentType) => row.title || `Content #${row.id}`}
/>