InfoAlertWithGraphicComponent
InfoGeneratePackages
This code defines a Ruby class called `InfoColorAlertComponent` that inherits from `ApplicationComponent`. It's designed to generate a template for displaying an informational alert on a web page. The template is structured as an HTML `div` element with a class indicating it's an alert of type info. Inside this `div`, it includes an SVG graphic symbolizing an information alert and a `span` element containing the text "New software update available." The SVG graphic is a circle with an exclamation mark in the center, drawn using path data. This component is likely part of a web application built with a Ruby-based framework that supports component-based web development, such as Ruby on Rails with ViewComponent or a similar technology.
# frozen_string_literal: true
class InfoColorAlertComponent < ApplicationComponent
def template
div(class: "alert alert-info", role: "alert") do
svg(xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", class: "stroke-current 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 { "New software update available." }
end
end
end
Try a prompt