Added new icon helper

This commit is contained in:
2024-08-27 11:24:50 +02:00
parent 1195da6843
commit 4f3342a850

View File

@@ -4,10 +4,17 @@ module ApplicationHelper
options[:aria] = true options[:aria] = true
options[:nocomment] = true options[:nocomment] = true
options[:variant] ||= :outline options[:variant] ||= :outline
#options[:class] = options.fetch(:class, nil) # options[:class] = options.fetch(:class, nil)
options[:class] = "size-5" unless options[:class] options[:class] = "size-5" unless options[:class]
path = options.fetch(:path, "icons/#{options[:variant]}/#{name}.svg") path = options.fetch(:path, "icons/#{options[:variant]}/#{name}.svg")
icon = path icon = path
inline_svg_tag(icon, options) inline_svg_tag(icon, options)
end end
def bool_icon(bool)
case bool
when true then "check"
else "x-mark"
end
end
end end