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

<%= @invite.name %>

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

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

<% else %>

<%= gettext("Invite Disabled") %>

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