mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-29 18:13:47 +00:00
@@ -86,6 +86,8 @@ export const subscriptionApi = {
|
|||||||
total_price_kopeks?: number;
|
total_price_kopeks?: number;
|
||||||
total_price_label?: string;
|
total_price_label?: string;
|
||||||
current_device_limit?: number;
|
current_device_limit?: number;
|
||||||
|
max_device_limit?: number;
|
||||||
|
can_add?: number;
|
||||||
days_left?: number;
|
days_left?: number;
|
||||||
base_device_price_kopeks?: number;
|
base_device_price_kopeks?: number;
|
||||||
}> => {
|
}> => {
|
||||||
|
|||||||
@@ -320,6 +320,7 @@
|
|||||||
"title": "Additional options",
|
"title": "Additional options",
|
||||||
"buyDevices": "Buy more devices",
|
"buyDevices": "Buy more devices",
|
||||||
"currentDeviceLimit": "Current limit: {{count}} devices",
|
"currentDeviceLimit": "Current limit: {{count}} devices",
|
||||||
|
"maxDevices": "max {{count}}",
|
||||||
"devicesUnavailable": "Device purchase is not available",
|
"devicesUnavailable": "Device purchase is not available",
|
||||||
"devicesUnit": "devices",
|
"devicesUnit": "devices",
|
||||||
"buy": "Buy",
|
"buy": "Buy",
|
||||||
@@ -484,7 +485,7 @@
|
|||||||
"copyLink": "Copy Link",
|
"copyLink": "Copy Link",
|
||||||
"copied": "Copied!",
|
"copied": "Copied!",
|
||||||
"shareButton": "Share",
|
"shareButton": "Share",
|
||||||
"shareMessage": "Join me on and earn up to {{percent}}% cashback!",
|
"shareMessage": "Join me on {{botName}} and earn up to {{percent}}% cashback!",
|
||||||
"shareHint": "Share this link with friends. When they sign up and make a purchase, you'll earn {{percent}}% commission!",
|
"shareHint": "Share this link with friends. When they sign up and make a purchase, you'll earn {{percent}}% commission!",
|
||||||
"stats": {
|
"stats": {
|
||||||
"totalReferrals": "Total Referrals",
|
"totalReferrals": "Total Referrals",
|
||||||
|
|||||||
@@ -229,6 +229,7 @@
|
|||||||
"title": "گزینههای اضافی",
|
"title": "گزینههای اضافی",
|
||||||
"buyDevices": "خرید دستگاه بیشتر",
|
"buyDevices": "خرید دستگاه بیشتر",
|
||||||
"currentDeviceLimit": "محدودیت فعلی: {{count}} دستگاه",
|
"currentDeviceLimit": "محدودیت فعلی: {{count}} دستگاه",
|
||||||
|
"maxDevices": "حداکثر {{count}}",
|
||||||
"devicesUnavailable": "خرید دستگاه در دسترس نیست",
|
"devicesUnavailable": "خرید دستگاه در دسترس نیست",
|
||||||
"devicesUnit": "دستگاه",
|
"devicesUnit": "دستگاه",
|
||||||
"buy": "خرید",
|
"buy": "خرید",
|
||||||
@@ -410,7 +411,7 @@
|
|||||||
"copyLink": "کپی لینک",
|
"copyLink": "کپی لینک",
|
||||||
"copied": "کپی شد!",
|
"copied": "کپی شد!",
|
||||||
"shareButton": "اشتراکگذاری",
|
"shareButton": "اشتراکگذاری",
|
||||||
"shareMessage": "از طریق لینک من به Cabinet بپیوند و تا {{percent}}٪ پاداش بگیر!",
|
"shareMessage": "از طریق لینک من به {{botName}} بپیوند و تا {{percent}}٪ پاداش بگیر!",
|
||||||
"shareHint": "این لینک را با دوستان به اشتراک بگذارید. وقتی ثبت نام کنند و خرید کنند، {{percent}}% کمیسیون دریافت میکنید!",
|
"shareHint": "این لینک را با دوستان به اشتراک بگذارید. وقتی ثبت نام کنند و خرید کنند، {{percent}}% کمیسیون دریافت میکنید!",
|
||||||
"stats": {
|
"stats": {
|
||||||
"totalReferrals": "کل معرفیها",
|
"totalReferrals": "کل معرفیها",
|
||||||
|
|||||||
@@ -342,6 +342,7 @@
|
|||||||
"title": "Дополнительные опции",
|
"title": "Дополнительные опции",
|
||||||
"buyDevices": "Докупить устройства",
|
"buyDevices": "Докупить устройства",
|
||||||
"currentDeviceLimit": "Текущий лимит: {{count}} устройств",
|
"currentDeviceLimit": "Текущий лимит: {{count}} устройств",
|
||||||
|
"maxDevices": "максимум {{count}}",
|
||||||
"devicesUnavailable": "Докупка устройств недоступна",
|
"devicesUnavailable": "Докупка устройств недоступна",
|
||||||
"devicesUnit": "устройств",
|
"devicesUnit": "устройств",
|
||||||
"buy": "Купить",
|
"buy": "Купить",
|
||||||
@@ -506,7 +507,7 @@
|
|||||||
"copyLink": "Копировать ссылку",
|
"copyLink": "Копировать ссылку",
|
||||||
"copied": "Скопировано!",
|
"copied": "Скопировано!",
|
||||||
"shareButton": "Поделиться",
|
"shareButton": "Поделиться",
|
||||||
"shareMessage": "Заходи в Cabinet по моей ссылке и получай до {{percent}}% кешбэка!",
|
"shareMessage": "Заходи в {{botName}} по моей ссылке и получай до {{percent}}% кешбэка!",
|
||||||
"shareHint": "Поделитесь ссылкой с друзьями. Когда они зарегистрируются и оплатят, вы получите {{percent}}% комиссии!",
|
"shareHint": "Поделитесь ссылкой с друзьями. Когда они зарегистрируются и оплатят, вы получите {{percent}}% комиссии!",
|
||||||
"stats": {
|
"stats": {
|
||||||
"totalReferrals": "Всего рефералов",
|
"totalReferrals": "Всего рефералов",
|
||||||
|
|||||||
@@ -229,6 +229,7 @@
|
|||||||
"title": "附加选项",
|
"title": "附加选项",
|
||||||
"buyDevices": "购买更多设备",
|
"buyDevices": "购买更多设备",
|
||||||
"currentDeviceLimit": "当前限制:{{count}} 台设备",
|
"currentDeviceLimit": "当前限制:{{count}} 台设备",
|
||||||
|
"maxDevices": "最多 {{count}} 台",
|
||||||
"devicesUnavailable": "设备购买不可用",
|
"devicesUnavailable": "设备购买不可用",
|
||||||
"devicesUnit": "台设备",
|
"devicesUnit": "台设备",
|
||||||
"buy": "购买",
|
"buy": "购买",
|
||||||
@@ -410,7 +411,7 @@
|
|||||||
"copyLink": "复制链接",
|
"copyLink": "复制链接",
|
||||||
"copied": "已复制!",
|
"copied": "已复制!",
|
||||||
"shareButton": "分享",
|
"shareButton": "分享",
|
||||||
"shareMessage": "通过我的链接加入 Cabinet,获取高达 {{percent}}% 返现!",
|
"shareMessage": "通过我的链接加入 {{botName}},获取高达 {{percent}}% 返现!",
|
||||||
"shareHint": "分享链接给朋友。当他们注册并付款后,您将获得 {{percent}}% 佣金!",
|
"shareHint": "分享链接给朋友。当他们注册并付款后,您将获得 {{percent}}% 佣金!",
|
||||||
"stats": {
|
"stats": {
|
||||||
"totalReferrals": "总推荐数",
|
"totalReferrals": "总推荐数",
|
||||||
|
|||||||
@@ -1014,12 +1014,14 @@ export default function Subscription() {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{devicePriceData?.available === false ? (
|
{/* Check if completely unavailable (no subscription, price not set, etc.) */}
|
||||||
|
{devicePriceData?.available === false && !devicePriceData?.max_device_limit ? (
|
||||||
<div className="py-4 text-center text-sm text-dark-400">
|
<div className="py-4 text-center text-sm text-dark-400">
|
||||||
{devicePriceData.reason || t('subscription.additionalOptions.devicesUnavailable')}
|
{devicePriceData.reason || t('subscription.additionalOptions.devicesUnavailable')}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
|
{/* Device selector - show even at max limit */}
|
||||||
<div className="flex items-center justify-center gap-6">
|
<div className="flex items-center justify-center gap-6">
|
||||||
<button
|
<button
|
||||||
onClick={() => setDevicesToAdd(Math.max(1, devicesToAdd - 1))}
|
onClick={() => setDevicesToAdd(Math.max(1, devicesToAdd - 1))}
|
||||||
@@ -1036,13 +1038,40 @@ export default function Subscription() {
|
|||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
onClick={() => setDevicesToAdd(devicesToAdd + 1)}
|
onClick={() => setDevicesToAdd(devicesToAdd + 1)}
|
||||||
|
disabled={
|
||||||
|
devicePriceData?.max_device_limit
|
||||||
|
? (devicePriceData.current_device_limit || 0) + devicesToAdd >=
|
||||||
|
devicePriceData.max_device_limit
|
||||||
|
: false
|
||||||
|
}
|
||||||
className="btn-secondary flex h-12 w-12 items-center justify-center !p-0 text-2xl"
|
className="btn-secondary flex h-12 w-12 items-center justify-center !p-0 text-2xl"
|
||||||
>
|
>
|
||||||
+
|
+
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{devicePriceData && (
|
{/* Show limit info when at or near max */}
|
||||||
|
{devicePriceData?.max_device_limit && (
|
||||||
|
<div className="text-center text-sm text-dark-400">
|
||||||
|
{t('subscription.additionalOptions.currentDeviceLimit', {
|
||||||
|
count: devicePriceData.current_device_limit || subscription.device_limit,
|
||||||
|
})}{' '}
|
||||||
|
/{' '}
|
||||||
|
{t('subscription.additionalOptions.maxDevices', {
|
||||||
|
count: devicePriceData.max_device_limit,
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Show reason if can't add requested amount */}
|
||||||
|
{devicePriceData?.available === false && devicePriceData?.reason && (
|
||||||
|
<div className="rounded-lg bg-warning-500/10 p-3 text-center text-sm text-warning-400">
|
||||||
|
{devicePriceData.reason}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Price info - only when available */}
|
||||||
|
{devicePriceData?.available && devicePriceData.price_per_device_label && (
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<div className="mb-2 text-sm text-dark-400">
|
<div className="mb-2 text-sm text-dark-400">
|
||||||
{devicePriceData.price_per_device_label}/
|
{devicePriceData.price_per_device_label}/
|
||||||
@@ -1055,7 +1084,7 @@ export default function Subscription() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{devicePriceData &&
|
{devicePriceData?.available &&
|
||||||
purchaseOptions &&
|
purchaseOptions &&
|
||||||
devicePriceData.total_price_kopeks &&
|
devicePriceData.total_price_kopeks &&
|
||||||
devicePriceData.total_price_kopeks > purchaseOptions.balance_kopeks && (
|
devicePriceData.total_price_kopeks > purchaseOptions.balance_kopeks && (
|
||||||
@@ -1071,6 +1100,7 @@ export default function Subscription() {
|
|||||||
onClick={() => devicePurchaseMutation.mutate()}
|
onClick={() => devicePurchaseMutation.mutate()}
|
||||||
disabled={
|
disabled={
|
||||||
devicePurchaseMutation.isPending ||
|
devicePurchaseMutation.isPending ||
|
||||||
|
!devicePriceData?.available ||
|
||||||
!!(
|
!!(
|
||||||
devicePriceData?.total_price_kopeks &&
|
devicePriceData?.total_price_kopeks &&
|
||||||
purchaseOptions &&
|
purchaseOptions &&
|
||||||
|
|||||||
Reference in New Issue
Block a user