feat: Enhance note creation and project cancellation with user information and translations

This commit is contained in:
2025-09-18 11:11:22 +02:00
parent 1a49919000
commit 8964a9b29b
6 changed files with 52 additions and 6 deletions

View File

@@ -24,6 +24,11 @@ export default function ProjectViewPage() {
const [notes, setNotes] = useState([]);
const [loading, setLoading] = useState(true);
// Helper function to add a new note to the list
const addNote = (newNote) => {
setNotes(prevNotes => [newNote, ...prevNotes]);
};
// Helper function to check if user can delete a note
const canDeleteNote = (note) => {
if (!session?.user) return false;
@@ -597,7 +602,7 @@ export default function ProjectViewPage() {
</CardHeader>
<CardContent>
<div className="mb-6">
<NoteForm projectId={params.id} />
<NoteForm projectId={params.id} onNoteAdded={addNote} />
</div>
{notes.length === 0 ? (
<div className="text-center py-12">