Sha256: d7c74636ee3235e6f74721715001ef75d2b7b63b55dedd757b54032ca43b0ab8

Contents?: true

Size: 710 Bytes

Versions: 11

Compression:

Stored size: 710 Bytes

Contents

# frozen_string_literal: true

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

    # @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

11 entries across 11 versions & 1 rubygems

Version Path
primer_view_components-0.0.115 previews/primer/time_ago_component_preview.rb
primer_view_components-0.0.114 previews/primer/time_ago_component_preview.rb
primer_view_components-0.0.113 previews/primer/time_ago_component_preview.rb
primer_view_components-0.0.112 previews/primer/time_ago_component_preview.rb
primer_view_components-0.0.111 previews/primer/time_ago_component_preview.rb
primer_view_components-0.0.110 previews/primer/time_ago_component_preview.rb
primer_view_components-0.0.109 previews/primer/time_ago_component_preview.rb
primer_view_components-0.0.108 previews/primer/time_ago_component_preview.rb
primer_view_components-0.0.107 previews/primer/time_ago_component_preview.rb
primer_view_components-0.0.106 previews/primer/time_ago_component_preview.rb
primer_view_components-0.0.105 previews/primer/time_ago_component_preview.rb