@ducor/react
Version:
admin template ui interface
15 lines (14 loc) • 969 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { twMerge } from "tailwind-merge";
import MenuItem from "./item";
import { useMenu } from "..";
var MenuChildren = function (_a) {
var items = _a.items, parentDepth = _a.parentDepth, isActive = _a.isActive;
var sidebar_type = useMenu().sidebar_type;
return isActive ? (_jsx("ul", { className: twMerge("flex flex-col gap-1 transition-all duration-300", ["mini", "compact"].includes(sidebar_type) &&
parentDepth === 0 &&
"absolute -left-4 transform bg-white z-90 p-2 shadow-lg rounded-xl min-w-[150px] h-fit border border-gray-200", sidebar_type === "full" &&
"border-l border-gray-300 dark:border-white ml-7", ["mini", "compact"].includes(sidebar_type) &&
"inset-[auto] mt-[-3rem] -right-36"), children: items.map(function (item, key) { return (_jsx(MenuItem, { depth: parentDepth + 1, item: item }, key)); }) })) : null;
};
export default MenuChildren;