defmodule LiveBeatsWeb.LiveHelpers do import Phoenix.LiveView import Phoenix.LiveView.Helpers alias LiveBeatsWeb.Router.Helpers, as: Routes alias Phoenix.LiveView.JS alias LiveBeats.Accounts alias LiveBeats.MediaLibrary def home_path(nil = _current_user), do: "/" def home_path(%Accounts.User{} = current_user), do: profile_path(current_user) def profile_path(current_user_or_profile, action \\ :show) def profile_path(%Accounts.User{} = current_user, action) do Routes.profile_path(LiveBeatsWeb.Endpoint, action, current_user.username) end def profile_path(%MediaLibrary.Profile{} = profile, action) do Routes.profile_path(LiveBeatsWeb.Endpoint, action, profile.username) end def connection_status(assigns) do ~H"""
<%= render_slot(@inner_block) %>
<%= live_flash(@flash, @kind) %>
<%= live_flash(@flash, @kind) %>
<%= render_slot(@inner_block) %>
<%= col.label %> | <% end %>
---|
<%= render_slot(col, row) %>
|
<% end %>
<%= col.label %> | <% end %>
---|