# frozen_string_literal: true
module IconHelper
# https://lucide.dev/
PATHS = {
# Navigation
hamburger: %(),
brush: %(),
images: %(),
library: %(),
group: %(),
tags: %(),
megaphone: %(),
message_square: %(),
lectern: %(),
swatch: %(),
settings: %(),
log_in: %(),
user: %(),
# Utility
plus: %(),
times: %(),
reset: %(),
replace: %(),
upload: %(),
stamp: %(),
power: %(),
circle_help: %(),
notepad: %(),
flag_left: %(),
ticket: %(),
key_square: %(),
# Pagination
chevron_left: %(),
chevron_right: %(),
ellipsis: %(),
# Posts
search: %(),
fullscreen: %(),
anchor: %(),
}.freeze
def svg_icon(name, *args)
options = args.extract_options!
width = options[:width] || 24
height = options[:height] || 24
tag.svg(
"xmlns": "http://www.w3.org/2000/svg",
"width": width,
"height": height,
"viewbox": "0 0 24 24",
"fill": "none",
"stroke": "currentColor",
"stroke-width": 2,
"stroke-linecap": "round",
"stroke-linejoin": "round",
) do
raw(PATHS[name]) # rubocop:disable Rails/OutputSafety
end
end
end