mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-10 11:13:48 +02:00
Confirmation Dialogs
This commit is contained in:
14
src-web/hooks/useConfirm.tsx
Normal file
14
src-web/hooks/useConfirm.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { useDialog } from '../components/DialogContext';
|
||||
import { Confirm } from './Confirm';
|
||||
|
||||
export function useConfirm() {
|
||||
const dialog = useDialog();
|
||||
return ({ title, description }: { title: string; description?: string }) => {
|
||||
dialog.show({
|
||||
title,
|
||||
description,
|
||||
hideX: true,
|
||||
render: Confirm,
|
||||
});
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user