carnet panel

This commit is contained in:
alma 2025-04-20 18:35:13 +02:00
parent 126ae41d31
commit 29028325a7

View File

@ -1,7 +1,7 @@
"use client";
import React, { useState, useEffect } from 'react';
import { Image, FileText, Link, List } from 'lucide-react';
import { Image, FileText, Link, List, Plus } from 'lucide-react';
interface Note {
id: string;
@ -46,7 +46,11 @@ export const Editor: React.FC<EditorProps> = ({ note, onSave, currentFolder = 'N
if (note) {
setTitle(note.title);
fetchNoteContent();
if (note.id) {
fetchNoteContent();
} else {
setContent('');
}
} else {
setTitle('');
setContent('');
@ -99,6 +103,22 @@ export const Editor: React.FC<EditorProps> = ({ note, onSave, currentFolder = 'N
}
};
if (!note) {
return (
<div className="flex flex-col h-full bg-carnet-bg items-center justify-center">
<div className="text-center">
<FileText className="h-12 w-12 text-carnet-text-muted mx-auto mb-4" />
<h2 className="text-xl font-semibold text-carnet-text-primary mb-2">
Sélectionnez une note
</h2>
<p className="text-carnet-text-muted">
Choisissez une note existante ou créez-en une nouvelle
</p>
</div>
</div>
);
}
return (
<div className="flex flex-col h-full bg-carnet-bg">
{/* Title Bar */}