Files
myeasycms-v2/apps/web/app/(dashboard)/home/_components/home-sidebar-account-selector.tsx
giancarlo 041efb89fb Remove team account related services and actions
Removed services and actions related to team account deletion as well as updated paths within other dependent files, better reflecting their new locations. Also, added a new service titled 'AccountBillingService' for handling billing-related operations and restructured the form layout and handled translation in 'team-account-danger-zone' component.
2024-03-28 15:27:56 +08:00

40 lines
928 B
TypeScript

'use client';
import { useRouter } from 'next/navigation';
import { AccountSelector } from '@kit/accounts/account-selector';
import featureFlagsConfig from '~/config/feature-flags.config';
import pathsConfig from '~/config/paths.config';
const features = {
enableTeamAccounts: featureFlagsConfig.enableTeamAccounts,
enableTeamCreation: featureFlagsConfig.enableTeamCreation,
};
export function HomeSidebarAccountSelector(props: {
accounts: Array<{
label: string | null;
value: string | null;
image: string | null;
}>;
collapsed: boolean;
}) {
const router = useRouter();
return (
<AccountSelector
collapsed={props.collapsed}
accounts={props.accounts}
features={features}
onAccountChange={(value) => {
if (value) {
const path = pathsConfig.app.accountHome.replace('[account]', value);
router.replace(path);
}
}}
/>
);
}