module ViewComponent::ContentAreas

def with(area, content = nil, &block)

Other tags:
    Private: -
def with(area, content = nil, &block)
  unless content_areas.include?(area)
    raise ArgumentError.new(
      "Unknown content_area '#{area}' for #{self} - expected one of '#{content_areas}'.\n\n" \
      "To fix this issue, add `with_content_area :#{area}` to #{self} or reference " \
      "a valid content area."
    )
  end
  if block
    content = view_context.capture(&block)
  end
  instance_variable_set("@#{area}".to_sym, content)
  nil
end

def with_content_areas(*areas)

def with_content_areas(*areas)
  ViewComponent::Deprecation.warn(
    "`with_content_areas` is deprecated and will be removed in ViewComponent v3.0.0.\n\n" \
    "Use slots (https://viewcomponent.org/guide/slots.html) instead."
  )
  if areas.include?(:content)
    raise ArgumentError.new(
      "#{self} defines a content area called :content, which is a reserved name. \n\n" \
      "To fix this issue, use another name, such as `:body`."
    )
  end
  areas.each do |area|
    define_method area.to_sym do
      content unless content_evaluated? # ensure content is loaded so content_areas will be defined
      instance_variable_get(:"@#{area}") if instance_variable_defined?(:"@#{area}")
    end
  end
  self.content_areas = areas
end