Refactor: - Improved consistency and robustness by standardizing file encoding arguments from 'utf-8' to 'utf8' across various file read/write operations. - Simplified status mapping logic in billing components and services by replacing switch statements with direct mapping objects for clearer and more maintainable code. - Enhanced type conversion and error handling in billing and internationalization components for improved reliability. - Updated sorting logic in team member tables for more predictable member ordering. - Improved error logging with sanitized output to prevent formatting issues. - Adjusted environment variable whitelisting to use a more flexible matching pattern. - Fix variables for sidebar style handling Style: - Refined spacing and layout in account selector and sidebar header components for better visual consistency.
48 lines
1.4 KiB
TypeScript
48 lines
1.4 KiB
TypeScript
import { CreditCard, Home, User } from 'lucide-react';
|
|
import { z } from 'zod';
|
|
|
|
import { NavigationConfigSchema } from '@kit/ui/navigation-schema';
|
|
|
|
import featureFlagsConfig from '~/config/feature-flags.config';
|
|
import pathsConfig from '~/config/paths.config';
|
|
|
|
const iconClasses = 'w-4';
|
|
|
|
const routes = [
|
|
{
|
|
label: 'common:routes.application',
|
|
children: [
|
|
{
|
|
label: 'common:routes.home',
|
|
path: pathsConfig.app.home,
|
|
Icon: <Home className={iconClasses} />,
|
|
end: true,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
label: 'common:routes.settings',
|
|
children: [
|
|
{
|
|
label: 'common:routes.profile',
|
|
path: pathsConfig.app.personalAccountSettings,
|
|
Icon: <User className={iconClasses} />,
|
|
},
|
|
featureFlagsConfig.enablePersonalAccountBilling
|
|
? {
|
|
label: 'common:routes.billing',
|
|
path: pathsConfig.app.personalAccountBilling,
|
|
Icon: <CreditCard className={iconClasses} />,
|
|
}
|
|
: undefined,
|
|
].filter((route) => !!route),
|
|
},
|
|
] satisfies z.infer<typeof NavigationConfigSchema>['routes'];
|
|
|
|
export const personalAccountNavigationConfig = NavigationConfigSchema.parse({
|
|
routes,
|
|
style: process.env.NEXT_PUBLIC_USER_NAVIGATION_STYLE,
|
|
sidebarCollapsed: process.env.NEXT_PUBLIC_HOME_SIDEBAR_COLLAPSED,
|
|
sidebarCollapsedStyle: process.env.NEXT_PUBLIC_SIDEBAR_COLLAPSIBLE_STYLE,
|
|
});
|