"use client";

import React from "react";
import { getFirstLeafMenu, useMenuStore } from "@/stores";

export function useNavbarData() {
  const menus = useMenuStore((state) => state.menus);
  return React.useMemo(
    () => menus.map((menu) => ({ title: menu.title, matchPath: menu.path, url: getFirstLeafMenu(menu)?.path || menu.path })),
    [menus]
  );
}
