# Menu Configuration Contracts
#
# Type contracts for menu configuration with support for multilingual menus.
# Single source of truth - no more duplicated labels between language files.

{
  # Multilingual labels for menu items
  MenuLabels = {
    en
      | String
      | doc "English label for menu item",

    es
      | String
      | doc "Spanish label for menu item",

    # Extensible for more languages
    # fr | String | optional,
    # de | String | optional,
  },

  # Routes for different languages
  MenuRoutes = {
    en
      | String
      | doc "English route path (e.g., '/about')",

    es
      | String
      | doc "Spanish route path (e.g., '/acerca-de')",

    # Alternate routes for language prefixed paths
    "en-alt"
      | String
      | doc "Alternate English route (e.g., '/en/about')"
      | optional,

    "es-alt"
      | String
      | doc "Alternate Spanish route (e.g., '/es/acerca-de')"
      | optional,

    # Extensible for more languages
    # fr | String | optional,
  },

  # Menu item configuration
  MenuItem = {
    id
      | String
      | doc "Unique identifier for menu item (e.g., 'home', 'about')",

    routes
      | MenuRoutes
      | doc "URL paths for each language",

    labels
      | MenuLabels
      | doc "Display labels for each language",

    icon
      | String
      | doc "Icon class (e.g., 'fas fa-user', 'lucide:home')"
      | optional,

    is_external
      | Bool
      | doc "Whether this links to an external URL"
      | default = false,

    enabled
      | Bool
      | doc "Whether this menu item is active"
      | default = true,

    order
      | Number
      | doc "Display order (lower numbers first)"
      | optional,

    children
      | Array MenuItem
      | doc "Nested submenu items"
      | optional,

    ..
  },

  # External link menu item (single URL, same for all languages)
  ExternalMenuItem = {
    id
      | String
      | doc "Unique identifier",

    url
      | String
      | doc "External URL (same for all languages)",

    label
      | String
      | doc "Display label (same for all languages)",

    icon
      | String
      | optional,

    enabled
      | Bool
      | default = true,

    order
      | Number
      | optional,

    is_external
      | Bool
      | doc "Must be true for external links"
      | default = true,

    visible_in
      | Array String
      | doc "Languages this item appears in. Empty/absent = all languages. Example: [\"es\"] shows only in Spanish."
      | optional,

    ..
  },

  # Root menu configuration
  MenuFile = {
    items
      | Array Dyn
      | doc "Menu items (internal or external links)",
  },
}
