defmodule NolaWeb.EventComponent do use Phoenix.Component def content(assigns = %{event: %{type: :day_changed}}) do ~H""" Day changed: <%= Date.to_string(@date) %> """ end def content(assigns = %{event: %{type: :quit}}) do ~H""" has quit: <%= @reason %> """ end def content(assigns = %{event: %{type: :part}}) do ~H""" has left: <%= @reason %> """ end def content(assigns = %{event: %{type: :nick}}) do ~H""" <%= @old_nick %> is now known as """ end def content(assigns = %{event: %{type: :join}}) do ~H""" joined """ end end