defmodule MemexWeb.Components.UserCard do @moduledoc """ Display card for a user """ use MemexWeb, :component alias Memex.Accounts.User attr :user, User, required: true slot(:inner_block, required: true) def user_card(assigns) do ~H"""

<%= @user.email %>

<%= if @user.confirmed_at do %> <%= gettext( "User was confirmed at%{confirmed_datetime}", confirmed_datetime: "" ) %> <.datetime datetime={@user.confirmed_at} /> <% else %> <%= gettext("Email unconfirmed") %> <% end %>

<%= gettext( "User registered on%{registered_datetime}", registered_datetime: "" ) %> <.datetime datetime={@user.inserted_at} />

<%= render_slot(@inner_block) %>
""" end end