func (a *App) InsertMsgMenu() (string, tview.Primitive, bool, bool) {
	modal := NewModalMenu().
		SetY(6).
		SetText("Save?").
		AddButtons([]string{"Yes", "No, Drop", "Continue Writing", "Edit Header"}).
		SetDoneFunc(func(buttonIndex int) {
			switch b := buttonIndex; b {
			case 0:
				a.im.newMsg.Body = a.im.buffer.String()
				msgapi.Areas[a.im.postArea].SaveMsg(a.im.newMsg.MakeBody())
				a.Pages.HidePage("InsertMsgMenu")
				a.Pages.RemovePage("InsertMsgMenu")
				a.Pages.SwitchToPage(fmt.Sprintf("ViewMsg-%s-%d", msgapi.Areas[a.im.curArea].GetName(), msgapi.Areas[a.im.curArea].GetLast()))
				a.Pages.RemovePage(fmt.Sprintf("InsertMsg-%s", msgapi.Areas[a.im.curArea].GetName()))
				a.App.SetFocus(a.Pages)
			case 1:
				a.Pages.HidePage("InsertMsgMenu")
				a.Pages.RemovePage("InsertMsgMenu")
				a.Pages.SwitchToPage(fmt.Sprintf("ViewMsg-%s-%d", msgapi.Areas[a.im.curArea].GetName(), msgapi.Areas[a.im.curArea].GetLast()))
				a.Pages.RemovePage(fmt.Sprintf("InsertMsg-%s", msgapi.Areas[a.im.curArea].GetName()))
				a.App.SetFocus(a.Pages)
			case 2:
				a.Pages.HidePage("InsertMsgMenu")
				a.App.SetFocus(a.im.eb)
			case 3:
				a.Pages.HidePage("InsertMsgMenu")
				a.App.SetFocus(a.im.eh)
			}
		})
	return "InsertMsgMenu", modal, false, false
}
InsertMsgMenu modal menu
package ui
import (
	"fmt"
	"github.com/askovpen/gossiped/pkg/config"
	"github.com/askovpen/gossiped/pkg/msgapi"
	"github.com/askovpen/gossiped/pkg/types"
	"github.com/askovpen/gossiped/pkg/ui/editor"
	"github.com/gdamore/tcell/v2"
	"github.com/rivo/tview"
)
const (
	newMsgTypeAnswer        = 1
	newMsgTypeAnswerNewArea = 2
	newMsgTypeForward       = 4
)
type IM struct {
	eb         *editor.View
	eh         *EditHeader
	newMsg     *msgapi.Message
	curArea    int
	postArea   int
	newMsgType int
	buffer     *editor.Buffer
}