diff --git a/components/ui/dropdown-menu.tsx b/components/ui/dropdown-menu.tsx index 46f141d..5322ef4 100644 --- a/components/ui/dropdown-menu.tsx +++ b/components/ui/dropdown-menu.tsx @@ -213,12 +213,31 @@ const DropdownHamburgerBetter: React.FC<{ {list.map((e, idx) => { + if (typeof e?.children === "function") { + return ( + { + event.stopPropagation(); + event.preventDefault(); + }} + className={cn( + "cursor-pointer hover:bg-gray-100 rounded-md", + e?.className ? e?.className : "" + )} + > + {e.children()} + + ); + } return ( { - event.stopPropagation(); - event.preventDefault(); + if (!e?.progration) { + event.stopPropagation(); + event.preventDefault(); + } if (typeof e?.onClick === "function") { e?.onClick(); } diff --git a/utils/action.tsx b/utils/action.tsx index 74f8daf..72e73e5 100644 --- a/utils/action.tsx +++ b/utils/action.tsx @@ -50,7 +50,7 @@ export const actionToast = async (data: { > - {msg_succes ? msg_succes : "Success"} + {msg_succes ? msg_succes : " Success"} ); @@ -63,7 +63,7 @@ export const actionToast = async (data: { - {msg_error ? msg_error : "Failed"}{" "} + {msg_error ? msg_error : " Failed"}{" "} {get(ex, "response.data.meta.message") || ex.message}. ,