Sha256: 44d3cd6d5aa85dde4b23bc7943a48ec302951aef3c41a8c66207addc2c075ebc

Contents?: true

Size: 458 Bytes

Versions: 7

Compression:

Stored size: 458 Bytes

Contents

# frozen_string_literal: true

module Primer
  # @label TimeAgoComponent
  class TimeAgoComponentPreview < ViewComponent::Preview
    # @param time datetime-local
    # @param micro [Boolean] toggle
    def default(time: Time.zone.now.to_s, micro: false)
      render(Primer::TimeAgoComponent.new(time: DateTime.parse(time), micro: micro))
    end

    def micro
      render(Primer::TimeAgoComponent.new(time: Time.zone.now, micro: true))
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
primer_view_components-0.0.104 previews/primer/time_ago_component_preview.rb
primer_view_components-0.0.103 previews/primer/time_ago_component_preview.rb
primer_view_components-0.0.102 previews/primer/time_ago_component_preview.rb
primer_view_components-0.0.101 previews/primer/time_ago_component_preview.rb
primer_view_components-0.0.100 previews/primer/time_ago_component_preview.rb
primer_view_components-0.0.99 previews/primer/time_ago_component_preview.rb
primer_view_components-0.0.98 previews/primer/time_ago_component_preview.rb