defmodule LSGWeb.EventComponent do use Phoenix.Component 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