2025-05-09 07:03:19 +08:00
|
|
|
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
|
|
|
|
import Home from '../pages/Home';
|
2025-05-09 09:22:14 +08:00
|
|
|
import Database from '../pages/Database';
|
2025-05-10 02:14:03 +08:00
|
|
|
import MainLayout from '../components/Layouts/MainLayout';
|
2025-05-09 10:18:49 +08:00
|
|
|
import Brands from '../pages/Brands';
|
2025-05-12 08:30:02 +08:00
|
|
|
import CreatorInbox from '@/pages/CreatorInbox';
|
|
|
|
import DividLayout from '@/components/Layouts/DividLayout';
|
|
|
|
import BrandsDetail from '@/pages/BrandsDetail';
|
|
|
|
import CampaignDetail from '../pages/CampaignDetail';
|
2025-05-09 07:03:19 +08:00
|
|
|
|
|
|
|
// Routes configuration object
|
|
|
|
const routes = [
|
|
|
|
{
|
|
|
|
path: '/',
|
|
|
|
element: <Home />,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/creator-discovery',
|
|
|
|
element: <Home />,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/creator-database',
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: '',
|
2025-05-09 09:22:14 +08:00
|
|
|
element: <Database />,
|
2025-05-09 07:03:19 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'tiktok',
|
2025-05-09 09:22:14 +08:00
|
|
|
element: <Database path='tiktok' />,
|
2025-05-09 07:03:19 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'instagram',
|
2025-05-09 09:22:14 +08:00
|
|
|
element: <Database path='instagram' />,
|
2025-05-09 07:03:19 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'youtube',
|
2025-05-09 09:22:14 +08:00
|
|
|
element: <Database path='youtube' />,
|
2025-05-09 07:03:19 +08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/private-creators/*',
|
|
|
|
element: <Home />,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/deep-analysis',
|
|
|
|
element: <Home />,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/brands',
|
2025-05-09 10:18:49 +08:00
|
|
|
element: <Brands />,
|
2025-05-09 07:03:19 +08:00
|
|
|
},
|
2025-05-12 08:30:02 +08:00
|
|
|
{
|
|
|
|
path: '/brands/:id',
|
|
|
|
element: <BrandsDetail />,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/brands/:brandId/campaigns/:campaignId',
|
|
|
|
element: <CampaignDetail />,
|
|
|
|
},
|
2025-05-09 07:03:19 +08:00
|
|
|
{
|
|
|
|
path: '/settings',
|
|
|
|
element: <Home />,
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
// Create router with routes wrapped in the layout
|
|
|
|
const router = createBrowserRouter([
|
|
|
|
{
|
|
|
|
path: '/',
|
2025-05-09 09:22:14 +08:00
|
|
|
element: <MainLayout />,
|
2025-05-09 07:03:19 +08:00
|
|
|
children: routes,
|
|
|
|
},
|
2025-05-10 02:14:03 +08:00
|
|
|
{
|
|
|
|
path: '/creator-inbox',
|
|
|
|
element: <DividLayout />,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: '',
|
|
|
|
element: <CreatorInbox />,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'templates',
|
|
|
|
element: <Home />,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2025-05-09 07:03:19 +08:00
|
|
|
]);
|
|
|
|
|
|
|
|
export default function Router() {
|
|
|
|
return <RouterProvider router={router} />;
|
|
|
|
}
|
|
|
|
|
|
|
|
export { routes };
|