package onboarding

import (
	_ "embed"
	"strings"
)

const mockAttachmentContentType = "text/html; charset=utf-8"

//go:embed assets/reply.zh-CN.md
var mockReplyChinese string

//go:embed assets/reply.en.md
var mockReplyEnglish string

//go:embed assets/reply.ja.md
var mockReplyJapanese string

//go:embed assets/index.zh-CN.html
var mockHTMLChinese []byte

//go:embed assets/index.en.html
var mockHTMLEnglish []byte

//go:embed assets/index.ja.html
var mockHTMLJapanese []byte

type localizedMockContent struct {
	ReplyMarkdown string
	HTML          []byte
}

func onboardingMockContent(acceptLanguage string) localizedMockContent {
	normalized := strings.ToLower(strings.TrimSpace(acceptLanguage))
	switch {
	case strings.HasPrefix(normalized, "zh"):
		return localizedMockContent{ReplyMarkdown: strings.TrimSpace(mockReplyChinese), HTML: append([]byte(nil), mockHTMLChinese...)}
	case strings.HasPrefix(normalized, "ja"):
		return localizedMockContent{ReplyMarkdown: strings.TrimSpace(mockReplyJapanese), HTML: append([]byte(nil), mockHTMLJapanese...)}
	default:
		return localizedMockContent{ReplyMarkdown: strings.TrimSpace(mockReplyEnglish), HTML: append([]byte(nil), mockHTMLEnglish...)}
	}
}
