defmodule LiveBeatsWeb.CoreComponents do use Phoenix.Component use LiveBeatsWeb, :verified_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_upload_path(%Accounts.User{} = user) do ~p"/#{user.username}/songs/new" end def profile_path(username) when is_binary(username) do unverified_path(LiveBeatsWeb.Endpoint, LiveBeatsWeb.Router, ~p"/#{username}") end def profile_path(%Accounts.User{} = current_user) do profile_path(current_user.username) end def profile_path(%MediaLibrary.Profile{} = profile) do profile_path(profile.username) end slot :inner_block def connection_status(assigns) do ~H"""
<%= render_slot(@inner_block) %>
<%= msg %>
<%= msg %>
<%= render_slot(@inner_block) %>
<%= col.label %> | <% end %>
---|
<%= render_slot(col, row) %>
|
<%= col.label %> | <% end %>
---|