diff --git a/server/priv/style.css b/server/priv/style.css index 8289dbb..a058471 100644 --- a/server/priv/style.css +++ b/server/priv/style.css @@ -106,6 +106,10 @@ body { flex-grow: 1; } } + + & .clear-transfers-form { + margin: 0.5em 0; + } } .arrival-list, diff --git a/shared/src/subway_gleam/shared/component/connecting_train.gleam b/shared/src/subway_gleam/shared/component/connecting_train.gleam index 4bc7daf..264d9d3 100644 --- a/shared/src/subway_gleam/shared/component/connecting_train.gleam +++ b/shared/src/subway_gleam/shared/component/connecting_train.gleam @@ -93,6 +93,20 @@ pub fn list( ) -> Element(a) { html.aside([attribute.id("connecting-trains")], [ html.ol([], list.filter_map(connecting_trains, li(_, current_time))), + case connecting_trains { + [] -> element.none() + _ -> + html.form( + [ + attribute.class("clear-transfers-form"), + attribute.action("./"), + attribute.method("get"), + ], + [ + html.button([], [html.text("Clear transfers")]), + ], + ) + }, ]) }