diff --git a/apps/web/app/(main)/pro/page.tsx b/apps/web/app/(main)/pro/page.tsx index 734dec3..14937d6 100644 --- a/apps/web/app/(main)/pro/page.tsx +++ b/apps/web/app/(main)/pro/page.tsx @@ -1,9 +1,11 @@ -import { getSubscription } from '@/actions/api/subscriptions'; +import { getSubscription, getSubscriptionPrices } from '@/actions/api/subscriptions'; import { getSessionUser } from '@/actions/session'; import { PageHeader } from '@/components/navigation'; import { TryFreeButton } from '@/components/subscription'; import { env } from '@/config/env'; +import { Enum_Subscriptionprice_Period as SubscriptionPricePeriod } from '@repo/graphql/types'; import { Button } from '@repo/ui/components/ui/button'; +import { formatMoney } from '@repo/utils/money'; import { ArrowRight, Crown, Infinity as InfinityIcon } from 'lucide-react'; import Link from 'next/link'; @@ -15,6 +17,13 @@ export default async function ProPage() { const canUseTrial = !usedTrialSubscription; + const { subscriptionPrices = [] } = await getSubscriptionPrices({ + filters: { + active: { eq: true }, + period: { ne: SubscriptionPricePeriod.Trial }, + }, + }); + const botUrl = new URL(env.BOT_URL); botUrl.searchParams.set('start', 'pro'); @@ -22,7 +31,7 @@ export default async function ProPage() {
{/* Hero Section */} -
+
@@ -33,14 +42,14 @@ export default async function ProPage() {
-

+

Pro {' '} Доступ

-

+

{hasActiveSubscription ? 'Ваш Pro доступ активен!' : 'Разблокируйте больше возможностей'} @@ -69,7 +78,7 @@ export default async function ProPage() { )}

-

+

Преимущества

@@ -92,6 +101,47 @@ export default async function ProPage() {
*/}
+ + {subscriptionPrices?.length > 0 && ( +
+

+ Цены +

+
+ {subscriptionPrices.map((price) => ( +
+ {price?.period === SubscriptionPricePeriod.Month && ( +
+ Популярный +
+ )} +
+
+ {formatMoney(price?.amount ?? 0)} +
+ {typeof price?.days === 'number' && ( +
+ {price.days} дн. +
+ )} +
+ {price?.description && ( +
+ {price.description} +
+ )} +
+ ))} +
+
+ )}