update dropdown-menu.tsx and action.tsx

This commit is contained in:
faisolavolut 2025-02-07 14:48:46 +07:00
parent 100b44f024
commit 1cafed30e8
2 changed files with 23 additions and 4 deletions

View File

@ -213,12 +213,31 @@ const DropdownHamburgerBetter: React.FC<{
<DropdownMenuSeparator />
<DropdownMenuGroup>
{list.map((e, idx) => {
if (typeof e?.children === "function") {
return (
<DropdownMenuItem
key={"menu-group-" + idx}
onClick={(event) => {
event.stopPropagation();
event.preventDefault();
}}
className={cn(
"cursor-pointer hover:bg-gray-100 rounded-md",
e?.className ? e?.className : ""
)}
>
{e.children()}
</DropdownMenuItem>
);
}
return (
<DropdownMenuItem
key={"menu-group-" + idx}
onClick={(event) => {
if (!e?.progration) {
event.stopPropagation();
event.preventDefault();
}
if (typeof e?.onClick === "function") {
e?.onClick();
}