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) => {
event.stopPropagation();
event.preventDefault();
if (!e?.progration) {
event.stopPropagation();
event.preventDefault();
}
if (typeof e?.onClick === "function") {
e?.onClick();
}

View File

@ -50,7 +50,7 @@ export const actionToast = async (data: {
>
<div className="flex text-green-700 items-center success-title font-semibold">
<Check className="h-6 w-6 mr-1 " />
{msg_succes ? msg_succes : "Success"}
{msg_succes ? msg_succes : " Success"}
</div>
</div>
);
@ -63,7 +63,7 @@ export const actionToast = async (data: {
<div className="flex flex-col w-full">
<div className="flex text-red-600 items-center">
<AlertTriangle className="h-4 w-4 mr-1" />
{msg_error ? msg_error : "Failed"}{" "}
{msg_error ? msg_error : " Failed"}{" "}
{get(ex, "response.data.meta.message") || ex.message}.
</div>
</div>,