mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-10 23:07:47 +00:00
12 lines
324 B
Ruby
12 lines
324 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ProductComponent < ViewComponentReflex::Component
|
|
def initialize(product:, columns:)
|
|
@columns = columns
|
|
@image = product.images[0] if product.images.any?
|
|
@name = product.name
|
|
@unit = "#{product.unit_value} #{product.variant_unit}"
|
|
@price = product.price
|
|
end
|
|
end
|