defmodule MonoTab.IndexLayout do use Tableau.Layout, layout: MonoTab.RootLayout use Phoenix.Component def template(assigns) do ~H"""

{@page[:title] || "Latest Posts"}

<%= if @page[:description] do %>

{@page[:description]}

<% end %> <%= if assigns[:posts] && length(@posts) > 0 do %> <% else %>

No posts found.

<% end %> {{:safe, render(@inner_content)}} """ end defp format_date(date_string) when is_binary(date_string) do case Date.from_iso8601(date_string) do {:ok, date} -> Calendar.strftime(date, "%B %d, %Y") {:error, _} -> date_string end end defp format_date(%Date{} = date), do: Calendar.strftime(date, "%B %d, %Y") defp format_date(_), do: "" end