//! Hotkey help overlay component. //! //! Displays available keyboard shortcuts while held. use leptos::prelude::*; /// Hotkey help overlay that shows available keyboard shortcuts. /// /// This component displays while the user holds down the `?` key. #[component] pub fn HotkeyHelp( /// Whether the help overlay is visible. #[prop(into)] visible: Signal, ) -> impl IntoView { let outer_class = move || { if visible.get() { "fixed inset-0 z-50 flex items-center justify-center pointer-events-none" } else { "hidden" } }; view! {
// Semi-transparent backdrop } } /// A single hotkey row with key and description. #[component] fn HotkeyRow( /// The key or key combination. key: &'static str, /// Description of what the key does. description: &'static str, ) -> impl IntoView { view! {
{key}
{description}
} }