carnet panel
This commit is contained in:
parent
126ae41d31
commit
29028325a7
@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import React, { useState, useEffect } from 'react';
|
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 {
|
interface Note {
|
||||||
id: string;
|
id: string;
|
||||||
@ -46,7 +46,11 @@ export const Editor: React.FC<EditorProps> = ({ note, onSave, currentFolder = 'N
|
|||||||
|
|
||||||
if (note) {
|
if (note) {
|
||||||
setTitle(note.title);
|
setTitle(note.title);
|
||||||
fetchNoteContent();
|
if (note.id) {
|
||||||
|
fetchNoteContent();
|
||||||
|
} else {
|
||||||
|
setContent('');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
setTitle('');
|
setTitle('');
|
||||||
setContent('');
|
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 (
|
return (
|
||||||
<div className="flex flex-col h-full bg-carnet-bg">
|
<div className="flex flex-col h-full bg-carnet-bg">
|
||||||
{/* Title Bar */}
|
{/* Title Bar */}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user