a web component that shows the replies to a linked bsky post as comments.
1import lustre
2import lustre/attribute
3import lustre/element.{type Element}
4import lustre/element/html
5import bsky_comments_widget/widget
6
7pub fn main() {
8 let app = lustre.simple(init, update, view)
9
10 let assert Ok(_) = widget.register()
11 let assert Ok(_) = lustre.start(app, "#app", Nil)
12
13 Nil
14}
15
16type Model =
17 Nil
18
19fn init(_) -> Model {
20 Nil
21}
22
23type Msg =
24 Nil
25
26fn update(_, _) -> Model {
27 Nil
28}
29
30fn view(_) -> Element(Msg) {
31 html.html([], [
32 html.head([], [
33 html.link([
34 attribute.rel("stylesheet"),
35 attribute.href("bsky_comments_widget.css"),
36 ]),
37 ]),
38 html.div([attribute.class("p-32 mx-auto w-full max-w-4xl")], [
39 widget.element([
40 widget.post_url(
41 "https://bsky.app/profile/mrgan.com/post/3michx3lqa22y",
42 ),
43 ]),
44 ]),
45 ])
46}