"use client";
import { Button } from "@kandev/ui/button";
import Link from "@/components/routing/app-link";
import { resolvePluginIcon } from "@/lib/plugins/icons";
import { usePluginRegistry } from "@/lib/plugins/registry";
type MobilePluginNavSectionProps = {
/** Closes the surrounding menu sheet once a plugin page is opened. */
onNavigate: () => void;
};
/**
* Mobile counterpart to the desktop sidebar's ``: the
* hamburger-sheet surface for plugin-registered "main"-section nav items
* (`registerNavItem({ section: "main" })`, the default). The desktop rail is
* `hidden md:block`, so without this section a plugin's own page has no phone
* entry point at all. "integrations"-section items keep rendering inside
* `MobileIntegrationsSection`.
*/
export function MobilePluginNavSection({ onNavigate }: MobilePluginNavSectionProps) {
const registry = usePluginRegistry();
const items = registry.getNavItems().filter((item) => (item.section ?? "main") === "main");
if (items.length === 0) return null;
return (