export interface SearchPage {
	label: string;
	href: string;
	keywords?: string[];
	icon?:
		| 'home'
		| 'page'
		| 'account'
		| 'service'
		| 'project'
		| 'report'
		| 'invoice'
		| 'customer'
		| 'calendar'
		| 'profile'
		| 'notification'
		| 'scope'
		| 'settings'
		| 'message';
}

export interface SearchEntity {
	type: 'account' | 'customer' | 'service' | 'project' | 'report' | 'invoice' | 'scope';
	id: string;
	label: string;
	sublabel?: string;
	href: string;
}

export type SearchResult = SearchPage | SearchEntity;

// Public pages - available to everyone
export const publicPages: SearchPage[] = [
	{ label: 'Home', href: '/', keywords: ['home', 'main', 'landing'], icon: 'home' },
	{
		label: 'Services',
		href: '/services',
		keywords: ['services', 'cleaning', 'janitorial'],
		icon: 'page'
	},
	{
		label: 'Pricing',
		href: '/pricing',
		keywords: ['pricing', 'cost', 'rates', 'quote'],
		icon: 'page'
	},
	{ label: 'About Us', href: '/about', keywords: ['about', 'company', 'story'], icon: 'page' },
	{
		label: 'Contact',
		href: '/contact',
		keywords: ['contact', 'support', 'help', 'phone', 'email'],
		icon: 'page'
	},
	{
		label: 'Our Standard',
		href: '/standard',
		keywords: ['standard', 'quality', 'guarantee'],
		icon: 'page'
	},
	{
		label: 'Privacy Policy',
		href: '/privacy',
		keywords: ['privacy', 'policy', 'data'],
		icon: 'page'
	},
	{ label: 'Terms of Use', href: '/terms', keywords: ['terms', 'use', 'legal'], icon: 'page' }
];

// Customer pages - available to CustomerProfileType users
export const customerPages: SearchPage[] = [
	{
		label: 'Customer Dashboard',
		href: '/customer',
		keywords: ['dashboard', 'home', 'overview'],
		icon: 'home'
	},
	{
		label: 'My Accounts',
		href: '/customer/accounts',
		keywords: ['accounts', 'locations', 'sites'],
		icon: 'account'
	},
	{
		label: 'Schedule',
		href: '/customer/schedule',
		keywords: ['schedule', 'upcoming', 'calendar', 'appointments'],
		icon: 'calendar'
	},
	{
		label: 'History',
		href: '/customer/history',
		keywords: ['history', 'past', 'completed', 'previous'],
		icon: 'page'
	},
	{
		label: 'Invoices',
		href: '/customer/invoices',
		keywords: ['invoices', 'billing', 'payment', 'pay'],
		icon: 'invoice'
	},
	{
		label: 'My Profile',
		href: '/customer/profile',
		keywords: ['profile', 'settings', 'account'],
		icon: 'profile'
	}
];

// Team pages - available to TeamProfileType users (any role)
export const teamPages: SearchPage[] = [
	{
		label: 'Team Dashboard',
		href: '/team',
		keywords: ['dashboard', 'home', 'overview'],
		icon: 'home'
	},
	{
		label: 'My Accounts',
		href: '/team/accounts',
		keywords: ['accounts', 'assigned', 'locations'],
		icon: 'account'
	},
	{
		label: 'My Services',
		href: '/team/services',
		keywords: ['services', 'scheduled', 'work'],
		icon: 'service'
	},
	{
		label: 'My Projects',
		href: '/team/projects',
		keywords: ['projects', 'assigned', 'jobs'],
		icon: 'project'
	},
	{
		label: 'My Reports',
		href: '/team/reports',
		keywords: ['reports', 'submitted', 'documents'],
		icon: 'report'
	},
	{
		label: 'My Profile',
		href: '/team/profile',
		keywords: ['profile', 'settings', 'account'],
		icon: 'profile'
	}
];

// Admin pages - available to ADMIN or TEAM_LEADER roles
export const adminPages: SearchPage[] = [
	{
		label: 'Admin Dashboard',
		href: '/admin',
		keywords: ['dashboard', 'admin', 'overview'],
		icon: 'home'
	},
	{
		label: 'Customers',
		href: '/admin/customers',
		keywords: ['customers', 'clients', 'companies'],
		icon: 'customer'
	},
	{
		label: 'Accounts',
		href: '/admin/accounts',
		keywords: ['accounts', 'locations', 'sites'],
		icon: 'account'
	},
	{
		label: 'Services',
		href: '/admin/services',
		keywords: ['services', 'scheduled', 'routine'],
		icon: 'service'
	},
	{
		label: 'Assign Services',
		href: '/admin/services/assign',
		keywords: ['assign', 'services', 'team'],
		icon: 'service'
	},
	{
		label: 'Projects',
		href: '/admin/projects',
		keywords: ['projects', 'jobs', 'one-time'],
		icon: 'project'
	},
	{
		label: 'Scopes',
		href: '/admin/scopes',
		keywords: ['scopes', 'templates', 'tasks'],
		icon: 'scope'
	},
	{
		label: 'Reports',
		href: '/admin/reports',
		keywords: ['reports', 'documents', 'submissions'],
		icon: 'report'
	},
	{
		label: 'Invoices',
		href: '/admin/invoices',
		keywords: ['invoices', 'billing', 'payments'],
		icon: 'invoice'
	},
	{
		label: 'Wave Invoices',
		href: '/admin/invoices/wave',
		keywords: ['wave', 'invoices', 'accounting'],
		icon: 'invoice'
	},
	{
		label: 'Calendar',
		href: '/admin/calendar',
		keywords: ['calendar', 'schedule', 'events'],
		icon: 'calendar'
	},
	{
		label: 'Profiles',
		href: '/admin/profiles',
		keywords: ['profiles', 'team', 'users', 'staff'],
		icon: 'profile'
	}
];

// Admin-only pages - available only to ADMIN role
export const adminOnlyPages: SearchPage[] = [
	{
		label: 'Notification Rules',
		href: '/admin/notifications',
		keywords: ['notifications', 'alerts', 'rules'],
		icon: 'notification'
	},
	{
		label: 'Event Log',
		href: '/admin/events',
		keywords: ['events', 'log', 'audit', 'history'],
		icon: 'page'
	}
];

// Shared pages - available to all authenticated users
export const sharedPages: SearchPage[] = [
	{
		label: 'Messages',
		href: '/messages',
		keywords: ['messages', 'inbox', 'chat', 'conversations'],
		icon: 'message'
	},
	{
		label: 'Notifications',
		href: '/notifications',
		keywords: ['notifications', 'alerts', 'updates'],
		icon: 'notification'
	}
];

// Color scheme mapping for entity types
export const entityColorSchemes: Record<string, string> = {
	account: 'primary',
	service: 'secondary',
	project: 'accent',
	report: 'accent2',
	customer: 'accent3',
	profile: 'accent4',
	invoice: 'accent6',
	calendar: 'accent7',
	scope: 'accent'
};

// Section header class mapping
export const sectionHeaderClasses: Record<string, string> = {
	pages: 'bg-surface-100 dark:bg-surface-800',
	account: 'section-header-primary',
	service: 'section-header-secondary',
	project: 'section-header-accent',
	report: 'section-header-accent2',
	customer: 'section-header-accent3',
	invoice: 'section-header-accent6',
	scope: 'section-header-accent'
};

// Badge class mapping
export const badgeClasses: Record<string, string> = {
	account: 'badge-primary',
	service: 'badge-secondary',
	project: 'badge-accent',
	report: 'badge-accent2',
	customer: 'badge-accent3',
	invoice: 'badge-accent6',
	scope: 'badge-accent'
};
