feat: Integrate content library features, allowing users to save and select blocks within the lesson editor.

This commit is contained in:
2026-02-16 20:52:57 -03:00
parent 9bdbd8ae5a
commit f9bea3c2e0
2 changed files with 65 additions and 4 deletions
+3 -3
View File
@@ -34,7 +34,7 @@ export default function LibraryPanel({ isOpen, onClose, onSelectBlock }: Library
const loadBlocks = async () => {
setLoading(true);
try {
const data = await api.listLibraryBlocks();
const data = await cmsApi.listLibraryBlocks();
setBlocks(data);
} catch (error) {
console.error('Error loading library blocks:', error);
@@ -68,7 +68,7 @@ export default function LibraryPanel({ isOpen, onClose, onSelectBlock }: Library
const handleUseBlock = async (block: LibraryBlock) => {
try {
// Increment usage counter
await api.incrementBlockUsage(block.id);
await cmsApi.incrementBlockUsage(block.id);
onSelectBlock(block);
onClose();
} catch (error) {
@@ -81,7 +81,7 @@ export default function LibraryPanel({ isOpen, onClose, onSelectBlock }: Library
if (!confirm('¿Estás seguro de eliminar este bloque de la biblioteca?')) return;
try {
await api.deleteLibraryBlock(blockId);
await cmsApi.deleteLibraryBlock(blockId);
setBlocks(blocks.filter(b => b.id !== blockId));
} catch (error) {
console.error('Error deleting block:', error);