package app

var (
	// NotFound is the ui element that is displayed when a request is not
	// routed.
	NotFound UI = &notFound{}
)

type notFound struct {
	Compo
	Icon string
}

func ( *notFound) (Context) {
	 := Window().Get("document").Call("getElementsByTagName", "link")

	for  := 0;  < .Length(); ++ {
		 := .Index()
		 := .Call("getAttribute", "rel")

		if .String() == "icon" {
			 := .Call("getAttribute", "href")
			.Icon = .String()
			return
		}
	}
}

func ( *notFound) () UI {
	return Div().
		Class("goapp-app-info").
		Body(
			Div().
				Class("goapp-notfound-title").
				Body(
					Text("4"),
					Img().
						Class("goapp-logo").
						Alt("0").
						Src(.Icon),
					Text("4"),
				),
			P().
				Class("goapp-label").
				Text("Not Found"),
		)
}