Sha256: 7ba195e1cb31b16ff41b8af28fe085ecacaa03f580eaf69a8ca5078ab8bfd00d
Contents?: true
Size: 485 Bytes
Versions: 15
Compression:
Stored size: 485 Bytes
Contents
class InputLabelComponent < ViewComponent::Base erb_template <<~ERB <a <%= sanitize @attributes.join(" ") %>> <%= @value ? @value : content %> </a> ERB def initialize(attributes = {}) @value = attributes[:value] || nil attributes[:class] = "block font-medium text-sm text-gray-700 dark:text-gray-300#{" #{attributes[:class]}" if attributes[:class]}" @attributes = attributes.without(:value).map { |key, attribute| "#{key}=\"#{attribute}\"" } end end
Version data entries
15 entries across 15 versions & 1 rubygems