- Tokens: bigger show-once token with primary Copy; warn when no policies are selected (OpenBao then inherits the creator's policies). - Identity forms get headings, wider cards and two-column policy lists. - Replace window.confirm with an in-app confirm dialog (falls back to window.confirm without a provider). - Show policies, aliases and members as chips in the identity tables. - Access panel: one row per secret instead of separate data/metadata rules. - Stack graph details below 60rem; phone-width rules for tables, nav, toolbar. - New favicon and page title; label the root "*" path as "everything". Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
19 lines
632 B
TypeScript
19 lines
632 B
TypeScript
import { createContext, useContext } from 'react'
|
|
|
|
export interface ConfirmOptions {
|
|
title: string
|
|
message?: string
|
|
/** Label of the confirming button, e.g. "Delete". */
|
|
confirmLabel: string
|
|
}
|
|
|
|
export type Confirm = (options: ConfirmOptions) => Promise<boolean>
|
|
|
|
export const ConfirmContext = createContext<Confirm | null>(null)
|
|
|
|
/** Ask before a destructive action. Falls back to the browser's confirm() when no provider is mounted. */
|
|
export function useConfirm(): Confirm {
|
|
const confirm = useContext(ConfirmContext)
|
|
return confirm ?? (async (o) => window.confirm(o.message ? `${o.title}\n${o.message}` : o.title))
|
|
}
|