Sha256: ad869041f2119ed4fa23356a8ad99e6b111cc34a2285646c478e8f317ab52f85
Contents?: true
Size: 577 Bytes
Versions: 15
Compression:
Stored size: 577 Bytes
Contents
class DropdownLinkComponent < ViewComponent::Base erb_template <<~ERB <a <%= sanitize @attributes.join(" ") %>> <%= content %> </a> ERB def initialize(attributes = {}) attributes[:class] = "block w-full px-4 py-2 text-start text-sm leading-5 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none focus:bg-gray-100 dark:focus:bg-gray-800 transition duration-150 ease-in-out#{" #{attributes[:class]}" if attributes[:class]}" @attributes = attributes.map { |key, attribute| "#{key}=\"#{attribute}\"" } end end
Version data entries
15 entries across 15 versions & 1 rubygems