Skip to content

Commit d224bf8

Browse files
committed
Add info component for pages
1 parent 1b480fc commit d224bf8

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

app/views/components/pages/info.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module Pages
2+
class Info < ApplicationComponent
3+
attr_reader :title, :description, :request_path
4+
def initialize(title:, description:, request_path:, **)
5+
@title = title
6+
@description = description
7+
@request_path = request_path
8+
end
9+
10+
def view_template
11+
a(
12+
href: request_path,
13+
data: {
14+
turbo_frame: "_top"
15+
},
16+
class: ["pb-2", "block"]
17+
) do
18+
div(class: "font-semibold") { title }
19+
div(class: "text-sm") { description }
20+
end
21+
end
22+
end
23+
end

0 commit comments

Comments
 (0)