fedimint_server_ui/dashboard/
invite.rs

1use maud::{Markup, html};
2
3// Card with invite code text and copy button
4pub fn render(invite_code: &str) -> Markup {
5    let observer_link = format!("https://observer.fedimint.org/nostr?check={invite_code}");
6
7    html! {
8        div class="card h-100" {
9            div class="card-header dashboard-header" { "Invite Code" }
10            div class="card-body" {
11                div class="alert alert-info text-break" {
12                    (invite_code)
13                }
14
15                // Flex container for both buttons side by side
16                div class="d-flex justify-content-center gap-2 mt-3" {
17                    button type="button" class="btn btn-outline-primary" id="copyInviteCodeBtn"
18                        onclick=(format!("navigator.clipboard.writeText('{}');", invite_code)) {
19                        "Copy to Clipboard"
20                    }
21
22                    a href=(observer_link) target="_blank" class="btn btn-outline-success" {
23                        "Announce on Nostr"
24                    }
25                }
26
27                p class="text-center mt-3" {
28                    "Share this invite code with users to onboard them to your federation."
29                }
30            }
31        }
32    }
33}