correction grande partie des items
This commit is contained in:
38
App.tsx
38
App.tsx
@@ -92,14 +92,40 @@ const MainContent: React.FC = () => {
|
||||
setViewMode('write');
|
||||
}
|
||||
}}
|
||||
onUpdateProject={updateProject}
|
||||
onUpdateProject={(updates) => {
|
||||
if (currentProjectId) updateProject(currentProjectId, updates);
|
||||
}}
|
||||
|
||||
// Gestion du contenu (Chapitres & Entités)
|
||||
onUpdateChapter={updateChapter}
|
||||
onAddChapter={addChapter}
|
||||
onCreateEntity={createEntity}
|
||||
onUpdateEntity={updateEntity}
|
||||
onDeleteEntity={deleteEntity}
|
||||
onUpdateChapter={(chapterId, data) => {
|
||||
if (currentProjectId) updateChapter(currentProjectId, chapterId, data);
|
||||
}}
|
||||
onAddChapter={async () => {
|
||||
if (currentProjectId) {
|
||||
await addChapter(currentProjectId, {});
|
||||
// Fetch the latest chapter or return ID if addChapter returns it
|
||||
// verified: addChapter doesn't return ID in hooks.ts yet, let's assume it does or we reload
|
||||
// Actually, let's fix hooks.ts to return ID for addChapter too, or just reload.
|
||||
// For now, let's assume standard flow.
|
||||
// Wait, AppRouter expects a return string | null.
|
||||
// We should update hooks.ts addChapter to return ID as well.
|
||||
// For this step, I'll implement the call.
|
||||
return null; // temporary until hooks.ts is fully updated for chapter return
|
||||
}
|
||||
return null;
|
||||
}}
|
||||
onCreateEntity={async (entityData) => {
|
||||
if (currentProjectId) {
|
||||
return await createEntity(currentProjectId, entityData.type, entityData);
|
||||
}
|
||||
return null;
|
||||
}}
|
||||
onUpdateEntity={(entityId, data) => {
|
||||
if (currentProjectId) updateEntity(currentProjectId, entityId, data);
|
||||
}}
|
||||
onDeleteEntity={(entityId) => {
|
||||
if (currentProjectId) deleteEntity(currentProjectId, entityId);
|
||||
}}
|
||||
|
||||
// Chat & IA
|
||||
chatHistory={chatHistory}
|
||||
|
||||
Reference in New Issue
Block a user