Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

1.3 KB
Raw Blame
// #region Path Parameter Types
export interface RouteParamsTypes {
  admin: { settings: { module: { module: string } } };
}
// #endregion

// #region Absolute Paths
export const ROUTES = {
  index: '/',
  admin: {
    index: '/admin',
    auth: '/admin/auth',
    setup: '/admin/setup',
    accounts: '/admin/accounts',
    ai: '/admin/ai',
    settings: { index: '/admin/settings', module: '/admin/settings/:module' },
    about: '/admin/about',
    notFound: '/admin/404',
  },
};
// #endregion

// #region Relative Paths
export const RELATIVE_ROUTES = {
  index: '/',
  admin: {
    index: 'admin',
    auth: 'auth',
    setup: 'setup',
    accounts: 'accounts',
    ai: 'ai',
    settings: { index: 'settings', module: ':module' },
    about: 'about',
    notFound: '404',
  },
};
// #endregion

// #region Path Factories
const home = () => '/';
const admin = () => '/admin';
admin.auth = () => '/admin/auth';
admin.setup = () => '/admin/setup';
admin.accounts = () => '/admin/accounts';
admin.ai = () => '/admin/ai';
const admin_settings = () => '/admin/settings';
admin_settings.module = (params: { module: string }) =>
  `/admin/settings/${params.module}`;
admin.settings = admin_settings;
admin.about = () => '/admin/about';
admin.notFound = () => '/admin/404';
export const FACTORIES = { admin, home };
// #endregion