package gg.jte.generated.ondemand;
import guestbook.Message;
import java.util.List;
@SuppressWarnings("unchecked")
public final class JteindexGenerated {
	public static final String JTE_NAME = "index.jte";
	public static final int[] JTE_LINE_INFO = {0,0,1,2,2,2,2,8,8,8,10,10,12,12,13,13,13,13,13,13,14,14,16,16,24,24,24,2,2,2,2};
	public static void render(gg.jte.html.HtmlTemplateOutput jteOutput, gg.jte.html.HtmlInterceptor jteHtmlInterceptor, List<Message> messages) {
		jteOutput.writeContent("\n<!DOCTYPE html>\n<html>\n<body>\n  <h1>Guestbook</h1>\n  ");
		if (messages.isEmpty()) {
			jteOutput.writeContent("\n    <p><em>No messages yet.</em></p>\n  ");
		} else {
			jteOutput.writeContent("\n    <ul>\n      ");
			for (var m : messages) {
				jteOutput.writeContent("\n        <li><strong>");
				jteOutput.setContext("strong", null);
				jteOutput.writeUserContent(m.name());
				jteOutput.writeContent("</strong>: ");
				jteOutput.setContext("li", null);
				jteOutput.writeUserContent(m.message());
				jteOutput.writeContent("</li>\n      ");
			}
			jteOutput.writeContent("\n    </ul>\n  ");
		}
		jteOutput.writeContent("\n  <form action=\"/submit\" method=\"POST\">\n    <label>Name: <input type=\"text\" name=\"name\"></label><br>\n    <label>Message: <input type=\"text\" name=\"message\"></label><br>\n    <button type=\"submit\">Post</button>\n  </form>\n</body>\n</html>\n");
	}
	public static void renderMap(gg.jte.html.HtmlTemplateOutput jteOutput, gg.jte.html.HtmlInterceptor jteHtmlInterceptor, java.util.Map<String, Object> params) {
		List<Message> messages = (List<Message>)params.get("messages");
		render(jteOutput, jteHtmlInterceptor, messages);
	}
}
