mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-17 23:14:03 +01:00
15 lines
343 B
TypeScript
15 lines
343 B
TypeScript
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,
|
|
});
|
|
};
|
|
}
|