(
- `SELECT * FROM product_subgroups ${where} ORDER BY name ASC`,
+ `SELECT ps.*, pg.name AS group_name
+ FROM product_subgroups ps
+ JOIN product_groups pg ON pg.id = ps.group_id
+ ${where}
+ ORDER BY ps.name ASC`,
params,
);
return rows;
diff --git a/packages/ui/src/components/AppShell.tsx b/packages/ui/src/components/AppShell.tsx
index 83612b8..e940064 100644
--- a/packages/ui/src/components/AppShell.tsx
+++ b/packages/ui/src/components/AppShell.tsx
@@ -12,7 +12,10 @@ export interface AppShellNavItem {
* When present (even if empty), this item renders as an expandable
* accordion group instead of a direct link — `href` is then only a
* placeholder (typically duplicated by the first child) and is never
- * navigated to directly. Only one level deep is supported.
+ * navigated to directly. A child may itself declare `children`, nesting
+ * another accordion one level deeper (e.g. Produtos > Grupos >
+ * Subgrupos) — depth beyond that is untested but not structurally
+ * prevented.
*/
children?: AppShellNavItem[];
}
@@ -101,16 +104,20 @@ function NavGroup({
{open ? (
- {(item.children ?? []).map((child) => (
-
- {child.icon}
- {child.label}
-
- ))}
+ {(item.children ?? []).map((child) =>
+ child.children ? (
+
+ ) : (
+
+ {child.icon}
+ {child.label}
+
+ ),
+ )}
) : null}