Sha256: 48b4e915dcb8cea55a30c0e45e51b7a8a2c57e50dbd1b806de38baa18ec37961
Contents?: true
Size: 691 Bytes
Versions: 24
Compression:
Stored size: 691 Bytes
Contents
# frozen_string_literal: true class Avo::Index::FieldWrapperComponent < ViewComponent::Base def initialize(field: nil, dash_if_blank: true, center_content: false, flush: false, **args) @field = field @dash_if_blank = dash_if_blank @center_content = center_content @classes = args[:class].present? ? args[:class] : "" @args = args @flush = flush end def classes result = @classes unless @flush result += " py-3" end result += " #{text_align_classes}" result end private def text_align_classes case @field.index_text_align.to_sym when :right 'text-right' when :center 'text-center' end end end
Version data entries
24 entries across 24 versions & 1 rubygems