defmodule MemexWeb.Components.InviteCard do @moduledoc """ Display card for an invite """ use MemexWeb, :component alias MemexWeb.Endpoint def invite_card(assigns) do ~H"""

<%= @invite.name %>

<%= if @invite.disabled_at |> is_nil() do %>

<%= gettext("Uses Left:") %> <%= @invite.uses_left || gettext("unlimited") %>

<% else %>

<%= gettext("invite disabled") %>

<% end %>
<%= Routes.user_registration_url(Endpoint, :new, invite: @invite.token) %> <%= if @code_actions do %> <%= render_slot(@code_actions) %> <% end %>
<%= if @inner_block do %>
<%= render_slot(@inner_block) %>
<% end %>
""" end end