-- vim: ft=terra
local terra 
render_userpage(co: &lib.srv.convo, actor: &lib.store.actor)
	var ti: lib.str.acc defer ti:free()
	if co.aid ~= 0 and co.who.id == actor.id then
		ti:compose('my profile')
	else
		ti:compose('profile :: ', actor.handle)
	end
	var pftxt = lib.render.profile(actor) defer pftxt:free()

	var doc = data.view.docskel {
		instance = co.srv.cfg.instance.ptr;
		title = ti.buf;
		body = pftxt.ptr;
		class = 'profile';
	}

	var hdrs = array(
		lib.http.header { 'Content-Type', 'text/html; charset=UTF-8' }
	)
	doc:send(co.con,200,[lib.mem.ptr(lib.http.header)] {ct = 1, ptr = &hdrs[0]})
end

return render_userpage
