# frozen_string_literal: true # rubocop:disable Yattho/ComponentNameMigration module Yattho # @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(Yattho::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(Yattho::TimeAgoComponent.new(time: DateTime.parse(time), micro: micro)) end def micro render(Yattho::TimeAgoComponent.new(time: Time.zone.now, micro: true)) end end end # rubocop:enable Yattho/ComponentNameMigration