= {
facts: { margin: 0, color: "var(--lp-muted)" },
note: { margin: 0, color: "var(--lp-muted)", fontSize: "var(--lp-fs-2xs)" },
alert: { margin: 0, color: "var(--lp-red-deep)", fontSize: "var(--lp-fs-2xs)" },
};
/**
* R32's pre-delete disclosure: the facts a reader needs before the button they already see.
*
* ⭐ NEVER OVER-EXPLAIN (DESIGN.md §4). One line of facts, and a second line only when the
* server could not answer or the delete already failed. There is no paragraph explaining what
* deleting means, and there is no confirmation control here at all: this renders INSIDE
* `ConfirmDialog`, which owns the title, Cancel, the red "Delete view", the focus trap and
* Escape.
*/
export function ViewDeleteDisclosure({
dependents,
share,
loading = false,
unanswered = [],
error = "",
}: ViewDeleteDisclosureProps) {
const facts = disclosureLine(share, dependents);
return (
<>
{loading ? (
Checking what depends on this view
) : facts ? (
{facts}
) : (
Nothing else depends on this view.
)}
{unanswered.length > 0 ? (
{unanswered.join(", ")} could not be checked, so this list may be incomplete.
) : null}
{error ? (
{error}
) : null}
>
);
}
export default ViewDeleteDisclosure;