I would do something like this:
attr :status, :atom, required: true
attr :classes, :string, default: ""
defp status_icon(%{status: status} = assigns) do
icon_name = case status do
:open -> "hero-inbox-solid text-emerald-500"
:closed -> "hero-lock-closed text-gray-500"
:archived -> "hero-archive-box text-gray-500"
_ -> "hero-question-mark-circle text-blue-500"
end
~H"<span class={[icon_name, @classes]} />"
end
And then use it as:
<.status_icon status={case.status} classes="h-4 w-4" />


















