local m = {}

function m.page(template, title)
	local title = "Admin: "..title

	if ctx.headers["X-DK-AJAX"] then
		return {
			html  = fs_read("templates/admin/"..template),
			title = title
		}
	end

	return send_html(render(
		fs_read("templates/admin/layout.html"),
		{
			title   = title,
			content = fs_read("templates/admin/"..template),
			version = "v1.0.0",
			build   = "Moonlight"
		}
	))
end

return m
