import { EnrichedMenuDataItem, MenuDataItem } from '../types.js';

export const addIdsToMenuItems = (
  items: MenuDataItem[]
): EnrichedMenuDataItem[] => {
  return items.map(item => ({
    ...item,
    _id: crypto.randomUUID(),
    children: item.children.length > 0 ? addIdsToMenuItems(item.children) : [],
  }));
};
