use crate::prelude::*;

fn Hello(name: &str) -> impl Template {
	template_fn(move |f| write!(f, "Hello, {name}"))
}

pub async fn view(
	request: Request,
	ctx: RequestCtx,
) -> HandlerResult<impl IntoResponse> {
	let name = ctx.path_params.get("name");

	let template = Hello(name).display();
	let output = format!("{template}");

	Ok(Html(output))
}
