feat: show traffic reset period on tariff cards

Display daily/weekly/monthly reset badge next to traffic and devices.
Hidden for NO_RESET tariffs.
This commit is contained in:
Fringg
2026-02-18 09:36:39 +03:00
parent 19e62fccf1
commit cfe9f642d8
6 changed files with 44 additions and 0 deletions

View File

@@ -246,6 +246,11 @@
"locationsLabel": "Locations",
"locations_one": "{{count}} location",
"locations_other": "{{count}} locations",
"trafficReset": {
"DAY": "Resets daily",
"WEEK": "Resets weekly",
"MONTH": "Resets monthly"
},
"traffic": "Traffic",
"unlimited": "Unlimited",
"used": "Used",

View File

@@ -241,6 +241,11 @@
"servers_other": "{{count}} سرور",
"locationsLabel": "مکان‌ها",
"locations_other": "{{count}} مکان",
"trafficReset": {
"DAY": "بازنشانی روزانه",
"WEEK": "بازنشانی هفتگی",
"MONTH": "بازنشانی ماهانه"
},
"traffic": "ترافیک",
"unlimited": "نامحدود",
"used": "استفاده شده",

View File

@@ -261,6 +261,11 @@
"locations_one": "{{count}} локация",
"locations_few": "{{count}} локации",
"locations_many": "{{count}} локаций",
"trafficReset": {
"DAY": "Сброс ежедневно",
"WEEK": "Сброс еженедельно",
"MONTH": "Сброс ежемесячно"
},
"traffic": "Трафик",
"unlimited": "Безлимит",
"used": "Использовано",

View File

@@ -241,6 +241,11 @@
"servers_other": "{{count}} 个服务器",
"locationsLabel": "位置",
"locations_other": "{{count}} 个位置",
"trafficReset": {
"DAY": "每日重置",
"WEEK": "每周重置",
"MONTH": "每月重置"
},
"traffic": "流量",
"unlimited": "无限",
"used": "已使用",

View File

@@ -2380,6 +2380,28 @@ export default function Subscription() {
{t('subscription.devices', { count: tariff.device_limit })}
</span>
</div>
{/* Traffic Reset */}
{tariff.traffic_reset_mode &&
tariff.traffic_reset_mode !== 'NO_RESET' && (
<div className="flex items-center gap-1.5">
<svg
className="h-4 w-4 text-dark-400"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
strokeWidth={1.5}
>
<path
strokeLinecap="round"
strokeLinejoin="round"
d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182M2.985 19.644l3.181-3.182"
/>
</svg>
<span className="text-dark-300">
{t(`subscription.trafficReset.${tariff.traffic_reset_mode}`)}
</span>
</div>
)}
</div>
{/* Price info - daily or period-based */}
<div className="mt-3 border-t border-dark-700/50 pt-3 text-sm text-dark-400">

View File

@@ -316,6 +316,8 @@ export interface Tariff {
daily_discount_percent?: number;
original_price_per_day_kopeks?: number;
custom_days_discount_percent?: number;
// Traffic reset
traffic_reset_mode?: string;
}
export interface TariffsPurchaseOptions {