# frozen_string_literal: true using Katalyst::HtmlAttributes::HasHtmlAttributes module Katalyst module Tables module Body # Formats the value as a number # # Adds a class to the cell to allow for custom styling class NumberComponent < BodyCellComponent def rendered_value value.present? ? number_to_human(value) : "" end def default_html_attributes super.merge_html(class: "type-number") end end end end end