export type MenuTarget =
  | { kind: 'url'; url: string; openInNew?: boolean }
  | { kind: 'entity'; entityType: string; entityId: string; openInNew?: boolean }

export type MenuRow = {
  id: string
  key: string
  label: string
  createdAtMs: number
  updatedAtMs: number
}

export type MenuItemRow = {
  id: string
  menuId: string
  parentId: string | null
  position: number
  depth: number
  label: string
  targetKind: 'url' | 'entity'
  url: string | null
  targetEntityType: string | null
  targetEntityId: string | null
  openInNew: boolean
  createdAtMs: number
  updatedAtMs: number
}

export type MenuItemNode = MenuItemRow & { children: MenuItemNode[] }
