import { RouteDefinition } from '@solidjs/router';

export interface AppRoute {
  path: string;
  label: string;
  icon?: string;
  requiresAuth?: boolean;
}

export const ROUTES: AppRoute[] = [
  { path: '/', label: 'Projects', icon: '📁', requiresAuth: true },
  { path: '/projects/:id', label: 'Project', icon: '📝', requiresAuth: true },
  { path: '/projects/:id/edit', label: 'Edit Project', icon: '✏️', requiresAuth: true },
  { path: '/settings', label: 'Settings', icon: '⚙️', requiresAuth: true },
  { path: '/settings/profile', label: 'Profile', icon: '👤', requiresAuth: true },
  { path: '/settings/team', label: 'Team', icon: '👥', requiresAuth: true },
  { path: '/sign-in', label: 'Sign In', icon: '🔑' },
  { path: '/sign-up', label: 'Sign Up', icon: '📝' },
];

export function getRouteConfig(path: string): AppRoute | undefined {
  return ROUTES.find(
    (r) => r.path === path || path.startsWith(r.path.replace(':id', ''))
  );
}

export function isAuthRequired(path: string): boolean {
  if (path === '/' || path.startsWith('/projects') || path.startsWith('/settings')) {
    return true;
  }
  return false;
}
