mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 19:00:46 +08:00
ui(managed-ne): replace import hint with help popover
Move bulk import and bastion/jump notes into a toolbar help popover to keep the action bar clean. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
7d74e7b3f4
commit
81c028949b
5 changed files with 114 additions and 78 deletions
|
|
@ -3,9 +3,10 @@ import { useEffect, useRef, useState } from "react";
|
|||
type Props = {
|
||||
text: string;
|
||||
ariaLabel: string;
|
||||
align?: "start" | "end";
|
||||
};
|
||||
|
||||
export function HelpHint({ text, ariaLabel }: Props) {
|
||||
export function HelpHint({ text, ariaLabel, align = "start" }: Props) {
|
||||
const [open, setOpen] = useState(false);
|
||||
const rootRef = useRef<HTMLSpanElement>(null);
|
||||
|
||||
|
|
@ -26,7 +27,7 @@ export function HelpHint({ text, ariaLabel }: Props) {
|
|||
}, [open]);
|
||||
|
||||
return (
|
||||
<span className="help-hint" ref={rootRef}>
|
||||
<span className={`help-hint${align === "end" ? " help-hint--align-end" : ""}`} ref={rootRef}>
|
||||
<button
|
||||
type="button"
|
||||
className="help-hint__trigger"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue