defmodule SelectoComponents.Components.ColumnConfig do use Phoenix.LiveComponent import SelectoComponents.Components.Common # slot :type, :atom # slot :uuid, :string # slot :field, :string # slog :config, :map def render(assigns) do assigns = Map.put(assigns, :prefix, "#{assigns.fieldname}[#{assigns.uuid}]") ~H"""
<%= case @col.type do%> <% x when x in [:int, :id, :decimal] -> %> <%= @col.name %> <% x when x in [:float] -> %> <%= @col.name %> <% x when x in [:string] -> %> <%= @col.name %> <% :boolean -> %> <%= @col.name %> <% x when x in [:naive_datetime, :utc_datetime] -> %> <%= @col.name %> <% _ -> %> <%= @col.name %> <% end %>
""" end # float formatting removed temp # --> end