module App = Editor_app module M = struct type t = unit let process : t -> State.t -> State.t = fun () state -> match state.page_id with | None -> state | Some page_id -> State.Storage.delete (fun () -> Some page_id); State.load_page None state end let create : unit -> App.event Note.event = fun () -> let title = Jstr.v "Confirmation" and message = Jstr.v "La page sera définitivement supprimée" in let ev = Elements.Popup.create ~title ~form:(Forms.Validation.create message) () in Note.E.map (fun v -> App.dispatch (module M) v) (Note.E.Option.on_some ev)