CookieConsentAlertComponent

InfoGeneratePackages

The given code snippet defines a Ruby class named "AlertWithButtonsComponent" which inherits from "ApplicationComponent". This class is designed to render a visual component, specifically an alert message with buttons. The component comprises:
1. An SVG icon, represented within a `div` element, acting as a visual symbol for the alert. The SVG is structured with various attributes to define its appearance and content.
2. A textual message within a `span` element stating "we use cookies for no reason.", serving as the alert's content or message to the user.
3. A `div` containing two buttons labeled "Deny" and "Accept". These buttons likely offer users the option to respond to the alert's message, possibly in the context of cookie usage consent.
The overall purpose of this code is to render an alert component within a web application, conveying a message about cookie usage along with providing user interaction options through buttons.

# frozen_string_literal: true

class AlertWithButtonsComponent < ApplicationComponent
  def template
    div(class: "alert", role: "alert") do
      svg(xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", class: "stroke-info shrink-0 w-6 h-6") do |svg|
        svg.path(stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z")
      end
      span { "we use cookies for no reason." }
      div do
        button(class: "btn btn-sm") { "Deny" }
        button(class: "btn btn-sm btn-primary") { "Accept" }
      end
    end
  end
end