import PlanPortfolio from "./components/PlanPortfolio";

  interface Route {
    path: string;
    auth:boolean
  }

  interface Routes {
    [key: string]: Route;
  }

  const routes :Routes = {
    home: { path: '/', auth: true },
    roomtype: { path: '/admin/room-type', auth: true },
    features: { path: '/admin/features', auth: true },
    homesection: { path: '/admin/home-section', auth: true },
    architecturestyle: { path: '/admin/architecture-style', auth: true },
    inspiration: { path: '/admin/inspiration', auth: true },
    gallery: { path: '/admin/gallery', auth: true },
    floorplan: { path: '/admin/floor-plan', auth: true },
    customer: { path: '/admin/customer', auth: true },
    generalsettings: { path: '/admin/settings', auth: true },

    planportfolio: { path: '/plan-portfolio', auth: true },
    plandetails: { path: '/plan-portfolio/:id', auth: true },
    inspirations: { path: '/inspiration', auth: true },
    inspirationpreview: { path: '/inspiration/:name', auth: true },
    galleries: { path: '/gallery', auth: true },
    gallerypreview: { path: '/gallery/:name', auth: true },
  };

  export const getPath = (routeKey: keyof Routes, params: Record<string, string | number> = {}) => {
    let path = routes[routeKey].path;
  
    Object.keys(params).forEach((key) => {
      path = path.replace(`[${key}]`, String(params[key])); 
    });
  
    return path;
  };
  
  export default routes;