diff --git a/admin/src/components/NoteListLayout/NoteListLayout.js b/admin/src/components/NoteListLayout/NoteListLayout.js index c4f65eb..5b0de9e 100644 --- a/admin/src/components/NoteListLayout/NoteListLayout.js +++ b/admin/src/components/NoteListLayout/NoteListLayout.js @@ -9,23 +9,28 @@ import NoteModal from '../NoteModal'; import NoteListItem from '../NoteListItem'; const NoteListLayout = () => { - const { isCreatingEntry, modifiedData, slug } = useCMEditViewDataManager(); - const { getNotes } = useNote(); - const { formatMessage } = useIntl(); - const [isNoteModalVisible, setIsNoteModalVisible] = useState(false); - const [activeNote, setActiveNote] = useState({}); - const [notes, setNotes] = useState([]); + const entity = useCMEditViewDataManager(); - if (isCreatingEntry) { + if (entity.isCreatingEntry) { return null; } - const id = modifiedData.id || false; - if (!id) { + if (!entity.modifiedData?.id) { return null; } - const entity = { id, slug }; + return ; +}; + +const NoteListManager = () => { + const { modifiedData, slug } = useCMEditViewDataManager(); + const { getNotes } = useNote(); + const { formatMessage } = useIntl(); + const [isNoteModalVisible, setIsNoteModalVisible] = useState(false); + const [activeNote, setActiveNote] = useState({}); + const [notes, setNotes] = useState([]); + + const entity = { id: modifiedData.id, slug }; const { isLoading, data, isRefetching } = getNotes({ filters: {