Make prompt() to return null on cancel

This commit is contained in:
Gregory Schier
2024-10-02 05:54:44 -07:00
parent 89ff25cd54
commit 4160e5b1c4
26 changed files with 436 additions and 108 deletions

View File

@@ -10,7 +10,7 @@ import { IconButton } from './IconButton';
export interface DialogProps {
children: ReactNode;
open: boolean;
onClose: () => void;
onClose?: () => void;
title?: ReactNode;
description?: ReactNode;
className?: string;
@@ -44,7 +44,7 @@ export function Dialog({
'Escape',
() => {
if (!open) return;
onClose();
onClose?.();
},
{},
[open],