Files
myeasycms-v2/apps/web/config/organization-account-sidebar.config.tsx
giancarlo 9796f109ba Rename "Organization" to "Team" across web app and update related services
Renamed all instances of "Organization" with "Team" across the entire web application to reflect the latest change in terminology. This further extends to renaming related services, components, and their respective invocation instances. Separate billing permissions have been defined for Team accounts, and security actions have been updated in SQL schema along with some layout adjustments.
2024-03-28 16:05:18 +08:00

51 lines
1.5 KiB
TypeScript

import { CreditCard, LayoutDashboard, Settings, Users } from 'lucide-react';
import { SidebarConfigSchema } from '@kit/ui/sidebar-schema';
import featureFlagsConfig from '~/config/feature-flags.config';
import pathsConfig from '~/config/paths.config';
const iconClasses = 'w-4';
const routes = (account: string) => [
{
label: 'common:dashboardTabLabel',
path: pathsConfig.app.accountHome.replace('[account]', account),
Icon: <LayoutDashboard className={iconClasses} />,
end: true,
},
{
label: 'common:settingsTabLabel',
collapsible: false,
children: [
{
label: 'common:settingsTabLabel',
path: createPath(pathsConfig.app.accountSettings, account),
Icon: <Settings className={iconClasses} />,
},
{
label: 'common:accountMembers',
path: createPath(pathsConfig.app.accountMembers, account),
Icon: <Users className={iconClasses} />,
},
featureFlagsConfig.enableTeamAccountBilling
? {
label: 'common:billingTabLabel',
path: createPath(pathsConfig.app.accountBilling, account),
Icon: <CreditCard className={iconClasses} />,
}
: undefined,
].filter(Boolean),
},
];
export function getOrganizationAccountSidebarConfig(account: string) {
return SidebarConfigSchema.parse({
routes: routes(account),
});
}
function createPath(path: string, account: string) {
return path.replace('[account]', account);
}