Sha256: ada2006fc3caf1539e0b7b0856b586b99a3dbf1db77210e9e693cf5cad733852

Contents?: true

Size: 372 Bytes

Versions: 28

Compression:

Stored size: 372 Bytes

Contents

module Coco
  class Avatar < Coco::Component
    include Concerns::AcceptsOptions

    accepts_option :size, from: %i[sm md lg xl full], default: :md

    attr_reader :src, :name

    def initialize(src:, name: nil, **)
      @src = src
      @name = name
    end

    def call
      render component_tag do
        tag.img src: src, alt: name
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
coveragebook_components-0.16.0 app/components/coco/images/avatar/avatar.rb
coveragebook_components-0.15.0 app/components/coco/images/avatar/avatar.rb
coveragebook_components-0.14.0 app/components/coco/images/avatar/avatar.rb
coveragebook_components-0.13.1 app/components/coco/images/avatar/avatar.rb
coveragebook_components-0.13.0 app/components/coco/images/avatar/avatar.rb
coveragebook_components-0.12.2 app/components/coco/shared/avatar/avatar.rb
coveragebook_components-0.12.1 app/components/coco/shared/avatar/avatar.rb
coveragebook_components-0.12.0 app/components/coco/shared/avatar/avatar.rb