diff --git a/packages/frontend/core/src/components/affine/setting-modal/general-setting/billing/index.tsx b/packages/frontend/core/src/components/affine/setting-modal/general-setting/billing/index.tsx
index c9a8c0089a..c67858abc1 100644
--- a/packages/frontend/core/src/components/affine/setting-modal/general-setting/billing/index.tsx
+++ b/packages/frontend/core/src/components/affine/setting-modal/general-setting/billing/index.tsx
@@ -21,6 +21,7 @@ import {
} from '@affine/graphql';
import { Trans } from '@affine/i18n';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
+import { assertExists } from '@blocksuite/global/utils';
import { ArrowRightSmallIcon } from '@blocksuite/icons';
import { useSetAtom } from 'jotai';
import { Suspense, useCallback, useMemo, useState } from 'react';
@@ -34,6 +35,8 @@ import { useUserSubscription } from '../../../../../hooks/use-subscription';
import { mixpanel, popupWindow } from '../../../../../utils';
import { SWRErrorBoundary } from '../../../../pure/swr-error-bundary';
import { CancelAction, ResumeAction } from '../plans/actions';
+import { useAffineAIPrice } from '../plans/ai/use-affine-ai-price';
+import { useAffineAISubscription } from '../plans/ai/use-affine-ai-subscription';
import * as styles from './style.css';
enum DescriptionI18NKey {
@@ -93,6 +96,11 @@ export const BillingSettings = () => {
const SubscriptionSettings = () => {
const [subscription, mutateSubscription] = useUserSubscription();
const [openCancelModal, setOpenCancelModal] = useState(false);
+ const {
+ actionType: aiActionType,
+ Action: AIAction,
+ billingTip,
+ } = useAffineAISubscription();
const { data: pricesQueryResult } = useQuery({
query: pricesQuery,
@@ -102,6 +110,10 @@ const SubscriptionSettings = () => {
const recurring = subscription?.recurring ?? SubscriptionRecurring.Monthly;
const price = pricesQueryResult.prices.find(price => price.plan === plan);
+ const aiPrice = pricesQueryResult.prices.find(
+ price => price.plan === SubscriptionPlan.AI
+ );
+ assertExists(aiPrice);
const amount =
plan === SubscriptionPlan.Free
? '0'
@@ -111,6 +123,8 @@ const SubscriptionSettings = () => {
: String((price.yearlyAmount ?? 0) / 100)
: '?';
+ const { priceReadable: aiPriceReadable, priceFrequency: aiPriceFrequency } =
+ useAffineAIPrice(aiPrice);
const t = useAFFiNEI18N();
const setOpenSettingModalAtom = useSetAtom(openSettingModalAtom);
@@ -167,6 +181,30 @@ const SubscriptionSettings = () => {
+
+
+
+
+ {aiPrice?.yearlyAmount ? (
+
+ {aiActionType === 'subscribe' ? 'Purchase' : null}
+
+ ) : null}
+
+
+ {aiPriceReadable}
+ /{aiPriceFrequency}
+
+
{subscription?.status === SubscriptionStatus.Active && (
<>