use leptos::*;

#[component]
pub fn BookADemo(
#[prop(optional)]
text: String
    ) -> impl IntoView {
    let (is_clicked, set_clicked) = create_signal(false);

    view! {
        <div>
        <button class="btn"
            on:click=move |_| {
                set_clicked.update(|is_clicked| *is_clicked = !*is_clicked)
            }
        >{text}</button>
            <div class="animate-vertical sm-margin-top-2" data-visible=is_clicked>
                <script src="https://embed.ycb.me" async="true" data-domain="jggc"></script>
            </div>
        </div>
    }
}
