package dialog

import (
	"github.com/wailsapp/wails/v2/pkg/runtime"
	"skapp/pkg/core"
)

func New(app *core.App) *Support {
	return &Support{app}
}

type Support struct {
	app *core.App
}

func (s *Support) OpenFileDialog(dialogOptions runtime.OpenDialogOptions) string {
	path, _ := runtime.OpenFileDialog(s.app.Ctx(), dialogOptions)
	return path
}

func (s *Support) OpenMultipleFilesDialog(dialogOptions runtime.OpenDialogOptions) []string {
	path, _ := runtime.OpenMultipleFilesDialog(s.app.Ctx(), dialogOptions)
	return path
}

func (s *Support) OpenDirectoryDialog(dialogOptions runtime.OpenDialogOptions) string {
	path, _ := runtime.OpenDirectoryDialog(s.app.Ctx(), dialogOptions)
	return path
}

func (s *Support) SaveFileDialog(dialogOptions runtime.SaveDialogOptions) string {
	path, _ := runtime.SaveFileDialog(s.app.Ctx(), dialogOptions)
	return path
}

func (s *Support) MessageDialog(dialogOptions runtime.MessageDialogOptions) string {
	path, _ := runtime.MessageDialog(s.app.Ctx(), dialogOptions)
	return path
}
