import { EntityKind, EntityVerdict } from '../../atoms/Chip'; /** A single supporting fact about the entity. */ export interface EntityAttribute { label: string; value: string; } export interface Entity { kind: EntityKind; /** Canonical, full value. Copy actions always yield this, never `display`. */ value: string; /** Shortened text the chip shows. Never what gets copied. */ display?: string; /** Omit when the value was never resolved. */ verdict?: EntityVerdict; attributes?: EntityAttribute[]; } export interface EntityMenuAction { id: string; label: string; icon?: React.ReactNode; /** * Why this action cannot be run, if it cannot. Rendered as text beneath the * label: a greyed row with no explanation reads as a bug and gets retried. */ unavailableReason?: string; } export interface EntityMenuProps { entity: Entity; /** The chip that opened the menu. */ anchorEl: HTMLElement | null; open: boolean; onClose: () => void; /** * Pivot and navigation actions, appended after the copy actions. Keep to * three or so: this menu opens from a word in a paragraph, so it is far too * easy to trigger by accident for anything destructive or privileged. Those * belong on the entity page behind confirmation and permission checks. */ actions?: EntityMenuAction[]; onAction?: (actionId: string, entity: Entity) => void; /** Suppresses the copy confirmation, for callers with their own Snackbar. */ disableCopyFeedback?: boolean; } /** * @example * const [anchor, setAnchor] = useState(null); * * setAnchor(e.currentTarget)} /> * setAnchor(null)} * actions={[{ id: 'pivot', label: 'Pivot to search' }]} * onAction={handleAction} * /> */ export declare function EntityMenu({ entity, anchorEl, open, onClose, actions, onAction, disableCopyFeedback, }: EntityMenuProps): import("react").JSX.Element; export default EntityMenu;