- Add specific case for 'info' flash message type in flash_icon helper - Initialize Lucide icons when flash message controller connects - Ensures icons render correctly with Turbo navigation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
32 lines
1016 B
Ruby
Executable File
32 lines
1016 B
Ruby
Executable File
module FlashMessagesHelper
|
|
def flash_class(type)
|
|
case type.to_s
|
|
when "notice", "success"
|
|
"bg-green-50 text-green-800 border-green-200"
|
|
when "error", "alert"
|
|
"bg-red-50 text-red-800 border-red-200"
|
|
when "warning"
|
|
"bg-yellow-50 text-yellow-800 border-yellow-200"
|
|
when "info"
|
|
"bg-blue-50 text-blue-800 border-blue-200"
|
|
else
|
|
"bg-gray-50 text-gray-800 border-gray-200"
|
|
end
|
|
end
|
|
|
|
def flash_icon(type)
|
|
case type.to_s
|
|
when "notice", "success"
|
|
content_tag :i, "", "data-lucide": "check-circle", class: "w-5 h-5 flex-shrink-0"
|
|
when "error", "alert"
|
|
content_tag :i, "", "data-lucide": "x-circle", class: "w-5 h-5 flex-shrink-0"
|
|
when "warning"
|
|
content_tag :i, "", "data-lucide": "alert-triangle", class: "w-5 h-5 flex-shrink-0"
|
|
when "info"
|
|
content_tag :i, "", "data-lucide": "info", class: "w-5 h-5 flex-shrink-0"
|
|
else
|
|
content_tag :i, "", "data-lucide": "bell", class: "w-5 h-5 flex-shrink-0"
|
|
end
|
|
end
|
|
end
|