Deleted the billing-redirect-button, checkout-redirect-button, and embedded-stripe-checkout components. Additionally, removed the shadcn directory, which encompassed billing-related icons. This change streamlines the subscription settings interface and organizes the system's payment management. This update is a stepping stone towards improving the billing system's overall architecture.
40 lines
960 B
TypeScript
40 lines
960 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 = {
|
|
enableOrganizationAccounts: featureFlagsConfig.enableOrganizationAccounts,
|
|
enableOrganizationCreation: featureFlagsConfig.enableOrganizationCreation,
|
|
};
|
|
|
|
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);
|
|
}
|
|
}}
|
|
/>
|
|
);
|
|
}
|