import {ICONS} from '@/shared/utils/icons';
import type {IconType} from '@astryxdesign/core/Icon';

export interface SettingsSection {
  label: string;
  href: string;
  icon: IconType;
  description: string;
}

/**
 * Settings sub-navigation.
 *
 * Same shape as the primary nav-config for the same reason: adding a section
 * should be a one-line push here plus a route folder, with nothing in the
 * layout changing.
 */
export const SETTINGS_NAV: SettingsSection[] = [
  {
    label: 'Business',
    href: '/settings',
    icon: ICONS.business,
    description: 'Company details, tax IDs, registered address and support.',
  },
  {
    label: 'Profile',
    href: '/settings/profile',
    icon: ICONS.profile,
    description: 'Merchant contact details, timezone and personal info.',
  },
  {
    label: 'Team & Staff',
    href: '/settings/team',
    icon: ICONS.staff,
    description: 'Staff directory, store assignments, roles and status.',
  },
  {
    label: 'Stores',
    href: '/settings/stores',
    icon: ICONS.stores,
    description: 'Manage store locations, operating hours and managers.',
  },
  {
    label: 'Roles & Permissions',
    href: '/settings/roles',
    icon: ICONS.roles,
    description: 'Access levels, module permissions and role matrices.',
  },
  {
    label: 'Notifications',
    href: '/settings/notifications',
    icon: ICONS.notifications,
    description: 'Email, SMS, WhatsApp and Push alert channels.',
  },
  {
    label: 'Billing',
    href: '/settings/billing',
    icon: ICONS.revenue,
    description: 'Subscription plans, payment methods and LYT settlement.',
  },
  {
    label: 'Integrations',
    href: '/settings/integrations',
    icon: ICONS.integrations,
    description: 'Connect Shopify, WooCommerce, Razorpay, WhatsApp and Meta.',
  },
  {
    label: 'API & Webhooks',
    href: '/settings/api',
    icon: ICONS.api,
    description: 'Developer API keys, webhook endpoints and delivery logs.',
  },
  {
    label: 'Security',
    href: '/settings/security',
    icon: ICONS.security,
    description: '2FA authentication, active sessions and audit history.',
  },
  {
    label: 'Preferences',
    href: '/settings/preferences',
    icon: ICONS.preferences,
    description: 'System theme, default currency, language and formats.',
  },
];

/** Exact match only — /settings must not stay active on /settings/billing. */
export function isSettingsActive(pathname: string, href: string): boolean {
  return pathname === href;
}
