From c9c3092d22cde4caf2fc2cc6193fda70f91ff50e Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Tue, 28 Feb 2023 22:15:50 -0500 Subject: [PATCH] fix(striker-ui): simplify ConfirmDialogProps init --- striker-ui/hooks/useConfirmDialogProps.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 striker-ui/hooks/useConfirmDialogProps.ts diff --git a/striker-ui/hooks/useConfirmDialogProps.ts b/striker-ui/hooks/useConfirmDialogProps.ts new file mode 100644 index 00000000..c638a41d --- /dev/null +++ b/striker-ui/hooks/useConfirmDialogProps.ts @@ -0,0 +1,19 @@ +import { Dispatch, SetStateAction, useState } from 'react'; + +const useConfirmDialogProps = ({ + actionProceedText = '', + content = '', + titleText = '', + ...restProps +}: Partial = {}): [ + ConfirmDialogProps, + Dispatch>, +] => + useState({ + actionProceedText, + content, + titleText, + ...restProps, + }); + +export default useConfirmDialogProps;