How to express functions in view (Phoenix 1.4) in new phoenix 1.7 viewless

I have found a way to solved it using de GitHub repo published in Programming Phoenix 1.4 book examples updated to 1.7 thread. Even so I would like to know your feedback mainly to find the best way to do it

the user_html.ex file

defmodule RumblWeb.UserHTML do
  use RumblWeb, :html

  embed_templates "user_html/*"

  def first_name(name) do
    name
    |> String.split(" ")
    |> Enum.at(0)
  end

end

controllers/user_html/index.html.heex

<h1>Listing Users</h1>
    <.table id="users" rows={@users}>
      <:col :let={user} label="name"><%= first_name(user.name) %> (<%= user.id %>)</:col>
      <:col :let={user} label="View"><.link href={~p"/users/#{user}"} class={[
                                        "rounded-lg bg-zinc-900 hover:bg-zinc-700 py-2 px-3",
                                        "text-sm font-semibold leading-6 text-white active:text-white/80"
                                        ]}>Show User</.link></:col>

    </.table>

controllers/user_html/show.html.heex


<.header>
  User
</.header>

<.list>
  <:item title="ID"><%= @user.id %></:item>
  <:item title="Name"><%= @user.name %></:item>
  <:item title="Username"><%= @user.username %></:item>
</.list>

The only thing make me feel I little bit uncomfortable with this approach is I haven´t found yet the way to reuse templates just like appears in the book where the template that shows user info is reused in the view that shows the list of users