defmodule FriendsWeb.FriendsLive.Components do use FriendsWeb, :live_component use Phoenix.HTML import Helpers alias Friends.Friend alias FriendsWeb.Components.{Autocomplete, Map} alias Phoenix.LiveView.JS def header(assigns) do ~H"""

<%= @friend.name %>

""" end def menu(assigns) do ~H""" """ end @spec edit_menu(any) :: Phoenix.LiveView.Rendered.t() def edit_menu(assigns) do if assigns.live_action == :welcome, do: "", else: ~H""" """ end def show_page(:main, assigns), do: show_page(:overview, %{assigns | live_action: :overview}) def show_page(:overview, assigns) do ~H""" """ end def show_page(:timeline, assigns) do ~H"""
<%= for event <- @friend |> Friends.Friend.get_events do %> <% end %> <%= if @friend |> Friends.Friend.get_events |> Enum.empty? do %>
None yet.
<% end %>
""" end def show_page(:relationships, assigns) do ~H"""
<%= for relation <- @friend |> relations do %> <% relationship = relation(@friend, relation) %>
{relation.id}

<%= relation.name %> <%= if relationship |> Friends.Relationship.get_relation do %>
Friends.Relationship.get_color}"}><%= relationship |> Friends.Relationship.get_relation %>
<% end %>

If a dog chews shoes whose shoes does he choose?

<% end %> <%= if @friend |> relations |> Enum.empty? do %>
No relationships on record yet.
<% end %>
""" end ### def edit_page(:welcome, assigns) do top = ~H"""

Welcome!

Before we get started, we just need some basic info about you:

<%= edit_page(:overview, assigns) %> """ end def edit_page(:overview, assigns) do ~H""" <.form for={@changeset} let={f} action={@action} phx_change= "validate" phx_submit= "save" > <%= hidden_input f, :id, value: @friend.id %>
<%= text_input f, :name, placeholder: "Full Name", class: "m-0 p-0 pb-2 pl-2 input input-bordered border-dashed", style: "color: var(--tw-prose-headings); font-weight: 800; font-size: 2.25em; min-width: 50%; text-indent: 4px; line-height: 1.1111111;", value: @friend.name, phx_debounce: :blur %>
<%= error_tag f, :name %>
<%= if @address_latlon do %> <% end %>
<%= if @live_action != :welcome do %>
<.link patch={Routes.friends_show_path(FriendsWeb.Endpoint, :overview, @friend.slug)} class="btn btn-block btn-outline">back
<% end %>
<%= if @changeset.valid? do %> <%= submit "Save", phx_disable_with: "Saving...", class: "btn btn-block" %> <% else %> <%= submit "Save", class: "btn btn-block btn-disabled" %> <% end %>
<%= if @current_user.profile.id == @friend.id do %>
<.link href={Routes.user_settings_path(FriendsWeb.Endpoint, :edit)} class="btn btn-block btn-error">Delete
<% end %>
""" end def edit_page(:relationships, assigns) do ~H""" """ end def edit_page(:timeline, assigns) do ~H""" """ end end