<%= gettext("invites") %>

<%= if @invites |> Enum.empty?() do %>

<%= gettext("no invites 😔") %>

<.link patch={Routes.invite_index_path(Endpoint, :new)} class="btn btn-primary"> <%= dgettext("actions", "invite someone new!") %> <% else %> <.link patch={Routes.invite_index_path(Endpoint, :new)} class="btn btn-primary"> <%= dgettext("actions", "create invite") %> <% end %>
<.invite_card :for={invite <- @invites} invite={invite}> <:code_actions>
<.link patch={Routes.invite_index_path(Endpoint, :edit, invite)} class="text-primary-400 link" data-qa={"edit-#{invite.id}"} > <.link href="#" class="text-primary-400 link" phx-click="delete_invite" phx-value-id={invite.id} data-confirm={ dgettext("prompts", "are you sure you want to delete the invite for %{invite_name}?", invite_name: invite.name ) } data-qa={"delete-#{invite.id}"} > <%= if invite.disabled_at, do: gettext("enable"), else: gettext("disable") %> is_nil() and not (invite.uses_left |> is_nil())} href="#" class="btn btn-primary" phx-click="set_unlimited" phx-value-id={invite.id} data-confirm={ dgettext("prompts", "are you sure you want to make %{invite_name} unlimited?", invite_name: invite.name ) } > <%= gettext("set unlimited") %>
<%= unless @admins |> Enum.empty?() do %>

<%= gettext("Admins") %>

<.user_card :for={admin <- @admins} user={admin}> <.link href="#" class="text-primary-400 link" phx-click="delete_user" phx-value-id={admin.id} data-confirm={ dgettext( "prompts", "are you sure you want to delete %{email}? This action is permanent!", email: admin.email ) } >
<% end %> <%= unless @users |> Enum.empty?() do %>

<%= gettext("users") %>

<.user_card :for={user <- @users} user={user}> <.link href="#" class="text-primary-400 link" phx-click="delete_user" phx-value-id={user.id} data-confirm={ dgettext( "prompts", "are you sure you want to delete %{email}? This action is permanent!", email: user.email ) } >
<% end %>
<.modal :if={@live_action in [:new, :edit]} return_to={Routes.invite_index_path(Endpoint, :index)}> <.live_component module={MemexWeb.InviteLive.FormComponent} id={@invite.id || :new} title={@page_title} action={@live_action} invite={@invite} return_to={Routes.invite_index_path(Endpoint, :index)} current_user={@current_user} />