feat: Enhance note creation and project cancellation with user information and translations
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user